mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-23 15:12:58 +00:00
Feature/ddl migration (#1111)
* REFACTOR: use functions from ddl-help * NEW: Default values are written to DDL * fix testcase for sqlserver as default constraints will get names in future * Reading DbMigration * ADD: DbmIgrationGenerateTest * Tables must be created first * Sanity checks and some getters * DdlMigration gets applied now * ADD: Testcase and reference migration scripts * no effective code changes: add comments
This commit is contained in:
1 parent
73b3d1d977
commit
dd8fff0277
90 files changed
+2767
-70
No files matched your search
@@ -0,0 +1,39 @@
|
||||
-- apply changes
|
||||
create table migtest_e_basic (
|
||||
id serial not null,
|
||||
status varchar(1),
|
||||
name varchar(255),
|
||||
description varchar(255),
|
||||
some_date timestamptz,
|
||||
old_boolean boolean default false not null,
|
||||
old_boolean2 boolean,
|
||||
eref_id integer,
|
||||
indextest1 varchar(255),
|
||||
indextest2 varchar(255),
|
||||
indextest3 varchar(255),
|
||||
indextest4 varchar(255),
|
||||
indextest5 varchar(255),
|
||||
indextest6 varchar(255),
|
||||
user_id integer not null,
|
||||
constraint ck_migtest_e_basic_status check ( status in ('N','A','I')),
|
||||
constraint uq_migtest_e_basic_indextest2 unique (indextest2),
|
||||
constraint uq_migtest_e_basic_indextest6 unique (indextest6),
|
||||
constraint pk_migtest_e_basic primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_history (
|
||||
id serial not null,
|
||||
test_string varchar(255),
|
||||
constraint pk_migtest_e_history primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id serial not null,
|
||||
constraint pk_migtest_e_ref primary key (id)
|
||||
);
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict;
|
||||
create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id);
|
||||
|
||||
Reference in new issue
Block a user