mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-24 01:44:38 +00:00
Fix dbmigration (#1277)
ENH: Support adding a '-- Generated by' comment to DDL including version and timestamp
This commit is contained in:
committed by
Rob Bygrave
parent
0e219a9bc6
commit
91cb5a23fd
@@ -113,7 +113,10 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
*/
|
||||
public final class Ebean {
|
||||
private static final Logger logger = LoggerFactory.getLogger(Ebean.class);
|
||||
|
||||
static {
|
||||
EbeanVersion.getVersion(); // initalizes the version class and logs the version.
|
||||
}
|
||||
|
||||
/**
|
||||
* Manages creation and cache of EbeanServers.
|
||||
*/
|
||||
|
||||
@@ -33,6 +33,10 @@ public class EbeanServerFactory {
|
||||
|
||||
private static SpiContainer container;
|
||||
|
||||
static {
|
||||
EbeanVersion.getVersion(); // initalizes the version class and logs the version.
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise the container with clustering configuration.
|
||||
* <p>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package io.ebean;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
/**
|
||||
* Class to determine the ebean version. (
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*
|
||||
*/
|
||||
public class EbeanVersion {
|
||||
private EbeanVersion() {
|
||||
|
||||
}
|
||||
private static final Logger logger = LoggerFactory.getLogger(EbeanVersion.class);
|
||||
|
||||
private static String version = "unknown";
|
||||
static {
|
||||
try {
|
||||
Properties prop = new Properties();
|
||||
InputStream in = Ebean.class.getResourceAsStream("/META-INF/maven/io.ebean/ebean/pom.properties");
|
||||
if (in != null) {
|
||||
prop.load(in);
|
||||
in.close();
|
||||
version = prop.getProperty("version");
|
||||
}
|
||||
logger.info("ebean version: {}", version);
|
||||
} catch (IOException e) {
|
||||
logger.warn("Could not determine ebean version: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ebean version (read from /META-INF/maven/io.ebean/ebean/pom.properties)
|
||||
*/
|
||||
public static String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
package io.ebean.config;
|
||||
|
||||
import io.ebean.EbeanVersion;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.migration.MigrationConfig;
|
||||
import io.ebean.migration.MigrationRunner;
|
||||
import io.ebean.util.StringHelper;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -116,6 +121,11 @@ public class DbMigrationConfig {
|
||||
*/
|
||||
protected boolean strictMode = true;
|
||||
|
||||
/**
|
||||
* Contains the DDL-header information.
|
||||
*/
|
||||
protected String ddlHeader;
|
||||
|
||||
/**
|
||||
* Return the DB platform to generate migration DDL for.
|
||||
* <p>
|
||||
@@ -387,6 +397,14 @@ public class DbMigrationConfig {
|
||||
return patchResetChecksumOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a DDL header prepend for each DDL. E.g. for copyright headers
|
||||
* You can use placeholders like ${version} or ${timestamp} in properties file.
|
||||
*/
|
||||
public String getDdlHeader() {
|
||||
return ddlHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set migration versions that should have their checksum reset and not run.
|
||||
* <p>
|
||||
@@ -454,6 +472,11 @@ public class DbMigrationConfig {
|
||||
String adminPwd = properties.get("datasource." + serverName + ".password", dbPassword);
|
||||
adminPwd = properties.get("datasource." + serverName + ".adminpassword", adminPwd);
|
||||
dbPassword = properties.get("migration.dbpassword", adminPwd);
|
||||
ddlHeader = properties.get("ddl.header", ddlHeader);
|
||||
if (ddlHeader != null && !ddlHeader.isEmpty()) {
|
||||
ddlHeader = StringHelper.replaceString(ddlHeader, "${version}", EbeanVersion.getVersion());
|
||||
ddlHeader = StringHelper.replaceString(ddlHeader, "${timestamp}", ZonedDateTime.now().format( DateTimeFormatter.ISO_INSTANT ));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -66,8 +66,13 @@ public class BaseDdlHandler implements DdlHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateExtra(DdlWrite write) throws IOException {
|
||||
tableDdl.generateExtra(write);
|
||||
public void generateProlog(DdlWrite write) throws IOException {
|
||||
tableDdl.generateProlog(write);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateEpilog(DdlWrite write) throws IOException {
|
||||
tableDdl.generateEpilog(write);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,5 +41,7 @@ public interface DdlHandler {
|
||||
|
||||
void generate(DdlWrite writer, DropIndex dropIndex) throws IOException;
|
||||
|
||||
void generateExtra(DdlWrite write) throws IOException;
|
||||
void generateProlog(DdlWrite write) throws IOException;
|
||||
|
||||
void generateEpilog(DdlWrite write) throws IOException;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,14 @@ public interface TableDdl {
|
||||
*/
|
||||
void generate(DdlWrite writer, DropIndex dropIndex) throws IOException;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generate any extra DDL such as stored procedures or TableValueParameters.
|
||||
*/
|
||||
void generateProlog(DdlWrite write) throws IOException;
|
||||
|
||||
/**
|
||||
* Generate any extra DDL such as regeneration of history triggers.
|
||||
*/
|
||||
void generateExtra(DdlWrite write) throws IOException;
|
||||
void generateEpilog(DdlWrite write) throws IOException;
|
||||
}
|
||||
|
||||
@@ -656,14 +656,20 @@ public class BaseTableDdl implements TableDdl {
|
||||
platformDdl.dropHistoryTable(writer, dropHistoryTable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateProlog(DdlWrite write) throws IOException {
|
||||
platformDdl.generateProlog(write);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called at the end to generate additional ddl such as regenerate history triggers.
|
||||
*/
|
||||
@Override
|
||||
public void generateExtra(DdlWrite write) throws IOException {
|
||||
public void generateEpilog(DdlWrite write) throws IOException {
|
||||
for (HistoryTableUpdate update : this.regenerateHistoryTriggers.values()) {
|
||||
platformDdl.regenerateHistoryTriggers(write, update);
|
||||
}
|
||||
platformDdl.generateEpilog(write);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -617,4 +617,19 @@ public class PlatformDdl {
|
||||
}
|
||||
apply.append(String.format("comment on column %s.%s is '%s'", table, column, comment)).endOfStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this to generate a prolog for each script (stored procedures)
|
||||
*/
|
||||
public void generateProlog(DdlWrite write) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this to generate an epilog. Will be added at the end of script
|
||||
*/
|
||||
public void generateEpilog(DdlWrite write) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -107,6 +107,10 @@ public class CurrentModel {
|
||||
createDdl();
|
||||
|
||||
StringBuilder ddl = new StringBuilder(2000);
|
||||
String header = server.getServerConfig().getMigrationConfig().getDdlHeader();
|
||||
if (header != null && !header.isEmpty()) {
|
||||
ddl.append(header).append('\n');
|
||||
}
|
||||
ddl.append(write.apply().getBuffer());
|
||||
ddl.append(write.applyForeignKeys().getBuffer());
|
||||
ddl.append(write.applyHistory().getBuffer());
|
||||
@@ -122,6 +126,10 @@ public class CurrentModel {
|
||||
createDdl();
|
||||
|
||||
StringBuilder ddl = new StringBuilder(2000);
|
||||
String header = server.getServerConfig().getMigrationConfig().getDdlHeader();
|
||||
if (header != null && !header.isEmpty()) {
|
||||
ddl.append(header).append('\n');
|
||||
}
|
||||
ddl.append(write.dropAllForeignKeys().getBuffer());
|
||||
ddl.append(write.dropAll().getBuffer());
|
||||
|
||||
@@ -139,7 +147,9 @@ public class CurrentModel {
|
||||
write = new DdlWrite(new MConfiguration(), model);
|
||||
|
||||
DdlHandler handler = handler();
|
||||
handler.generateProlog(write);
|
||||
handler.generate(write, createChangeSet);
|
||||
handler.generateEpilog(write);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,14 +45,14 @@ public class PlatformDdlWriter {
|
||||
public void processMigration(Migration dbMigration, DdlWrite write, File writePath, String fullVersion) throws IOException {
|
||||
|
||||
DdlHandler handler = handler();
|
||||
|
||||
handler.generateProlog(write);
|
||||
List<ChangeSet> changeSets = dbMigration.getChangeSet();
|
||||
for (ChangeSet changeSet : changeSets) {
|
||||
if (isApply(changeSet)) {
|
||||
handler.generate(write, changeSet);
|
||||
}
|
||||
}
|
||||
handler.generateExtra(write);
|
||||
handler.generateEpilog(write);
|
||||
|
||||
writePlatformDdl(write, writePath, fullVersion);
|
||||
}
|
||||
@@ -88,6 +88,10 @@ public class PlatformDdlWriter {
|
||||
*/
|
||||
protected void writeApplyDdl(Writer writer, DdlWrite write) throws IOException {
|
||||
|
||||
String header = config.getDdlHeader();
|
||||
if (header != null) {
|
||||
writer.append(header).append('\n');
|
||||
}
|
||||
// merge the apply buffers in the appropriate order
|
||||
prependDropDependencies(writer, write.applyDropDependencies());
|
||||
writer.append("-- apply changes\n");
|
||||
|
||||
@@ -90,7 +90,9 @@ public class ModelBuildBeanVisitor implements BeanVisitor {
|
||||
if (!descriptor.isIdTypePlatformDefault() || initialValue > 0 || allocationSize > 0) {
|
||||
// explicitly set to use sequence or identity (generally not recommended practice)
|
||||
if (IdType.IDENTITY == descriptor.getIdType()) {
|
||||
table.setIdentityType(IdentityType.IDENTITY);
|
||||
if (!descriptor.isIdTypePlatformDefault()) {
|
||||
table.setIdentityType(IdentityType.IDENTITY);
|
||||
}
|
||||
} else {
|
||||
// explicit sequence defined
|
||||
table.setIdentityType(IdentityType.SEQUENCE);
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ public class ModelBuild_compoundKeyTest extends BaseTestCase {
|
||||
String apply = Helper.asText(this, "/assert/ModelBuild_compoundKeyTest/apply.sql");
|
||||
|
||||
String createDdl = currentModel.getCreateDdl();
|
||||
assertThat(createDdl).isEqualTo(apply);
|
||||
assertThat(createDdl).startsWith("-- Generated by ebean").endsWith(apply);
|
||||
|
||||
}
|
||||
|
||||
@@ -81,6 +81,6 @@ public class ModelBuild_compoundKeyTest extends BaseTestCase {
|
||||
String createDdl = currentModel.getCreateDdl();
|
||||
String apply = Helper.asText(this, "/assert/ModelBuild_compoundKeyTest/apply.sql");
|
||||
|
||||
assertThat(createDdl).isEqualTo(apply);
|
||||
assertThat(createDdl).startsWith("-- Generated by ebean").endsWith(apply);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -45,7 +45,9 @@ public class ModelBuild_explicitSequencesTest extends BaseTestCase {
|
||||
CurrentModel currentModel = new CurrentModel(ebeanServer);
|
||||
|
||||
String apply = currentModel.getCreateDdl();
|
||||
assertThat(apply).isEqualTo(Helper.asText(this, "/assert/ModelBuild_explicitSequencesTest/apply.sql"));
|
||||
assertThat(apply)
|
||||
.startsWith("-- Generated by ebean")
|
||||
.endsWith(Helper.asText(this, "/assert/ModelBuild_explicitSequencesTest/apply.sql"));
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +58,9 @@ public class ModelBuild_explicitSequencesTest extends BaseTestCase {
|
||||
CurrentModel currentModel = new CurrentModel(ebeanServer);
|
||||
|
||||
String apply = currentModel.getCreateDdl();
|
||||
assertThat(apply).isEqualTo(Helper.asText(this, "/assert/ModelBuild_explicitSequencesTest/pg-apply.sql"));
|
||||
assertThat(apply)
|
||||
.startsWith("-- Generated by ebean")
|
||||
.endsWith(Helper.asText(this, "/assert/ModelBuild_explicitSequencesTest/pg-apply.sql"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column old_boolean;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column new_string_field;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column old_boolean;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- drop dependencies
|
||||
drop trigger migtest_e_history_history_upd;
|
||||
drop view migtest_e_history_with_history;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id integer generated by default as identity (start with 1) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity (start with 1) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column old_boolean;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity (start with 1) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column new_string_field;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column old_boolean;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- drop dependencies
|
||||
drop trigger migtest_e_history_history_upd;
|
||||
drop trigger migtest_e_history_history_del;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id number(10) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id number(10) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column old_boolean;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_ref (
|
||||
id number(10) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column new_string_field;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id serial not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- drop dependencies
|
||||
drop view if exists migtest_e_history2_with_history;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column old_boolean;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_ref (
|
||||
id serial not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- drop dependencies
|
||||
drop trigger if exists migtest_e_history_history_upd on migtest_e_history cascade;
|
||||
drop function if exists migtest_e_history_history_version();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id integer not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column old_boolean;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_ref (
|
||||
id integer not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
alter table migtest_e_basic drop column new_string_field;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id integer identity(1,1) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer identity(1,1) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
-- drop column migtest_e_basic.old_boolean;
|
||||
IF (OBJECT_ID('uq_migtest_e_basic_old_boolean', 'UQ') IS NOT NULL) alter table migtest_e_basic drop constraint uq_migtest_e_basic_old_boolean;
|
||||
@@ -39,3 +40,4 @@ IF OBJECT_ID('fk_migtest_e_basic_eref_id', 'F') IS NOT NULL alter table migtest_
|
||||
alter table migtest_e_basic drop column eref_id;
|
||||
|
||||
IF OBJECT_ID('migtest_e_ref', 'U') IS NOT NULL drop table migtest_e_ref;
|
||||
IF OBJECT_ID('migtest_e_ref_seq', 'SO') IS NOT NULL drop sequence migtest_e_ref_seq;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
create table migtest_e_ref (
|
||||
id integer identity(1,1) not null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Migrationscripts for ebean unittest
|
||||
-- apply changes
|
||||
-- drop column migtest_e_basic.new_string_field;
|
||||
IF (OBJECT_ID('uq_migtest_e_basic_new_string_field', 'UQ') IS NOT NULL) alter table migtest_e_basic drop constraint uq_migtest_e_basic_new_string_field;
|
||||
@@ -104,6 +105,7 @@ IF OBJECT_ID('fk_migtest_e_softdelete_deleted', 'F') IS NOT NULL alter table mig
|
||||
alter table migtest_e_softdelete drop column deleted;
|
||||
|
||||
IF OBJECT_ID('migtest_e_user', 'U') IS NOT NULL drop table migtest_e_user;
|
||||
IF OBJECT_ID('migtest_e_user_seq', 'SO') IS NOT NULL drop sequence migtest_e_user_seq;
|
||||
-- dropping history support for migtest_e_history;
|
||||
delimiter $$
|
||||
DECLARE @Tmp nvarchar(200);select @Tmp = t1.name from sys.default_constraints t1
|
||||
|
||||
@@ -18,6 +18,7 @@ ebean.encryptKeyManager=org.tests.basic.encrypt.BasicEncyptKeyManager
|
||||
ebean.sqlserver.ddl.createOnly=true
|
||||
ebean.ddl.generate=true
|
||||
ebean.ddl.run=true
|
||||
ebean.ddl.header=-- Generated by ebean ${version} at ${timestamp}
|
||||
ebean.packages=org.tests
|
||||
datasource.default=h2
|
||||
|
||||
@@ -152,6 +153,7 @@ datasource.migrationtest.databaseDriver=org.h2.Driver
|
||||
ebean.migrationtest.applyPrefix=V
|
||||
ebean.migrationtest.ddl.generate=false
|
||||
ebean.migrationtest.ddl.run=false
|
||||
ebean.migrationtest.ddl.header=-- Migrationscripts for ebean unittest
|
||||
ebean.migrationtest.migration.appName=migrationtest
|
||||
ebean.migrationtest.migration.migrationPath=dbmigration/migrationtest
|
||||
ebean.migrationtest.migration.strict=true
|
||||
|
||||
Reference in New Issue
Block a user