mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-19 23:02:24 +00:00
Reference scripts
This commit is contained in:
1 parent
a8f390c3b7
commit
e4ddcbd40a
61 files changed
-326
No files matched your search
@@ -34,8 +34,6 @@ create table migtest_mtm_m_phone_numbers (
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
update migtest_e_basic set status = 'A' where status is null;
|
||||
alter table migtest_e_basic modify status varchar(1) not null default 'A';
|
||||
alter table migtest_e_basic modify status2 varchar(127);
|
||||
@@ -44,7 +42,6 @@ alter table migtest_e_basic modify status2 varchar(127);
|
||||
|
||||
insert into migtest_e_user (id) select distinct user_id from migtest_e_basic;
|
||||
alter table migtest_e_basic modify user_id integer;
|
||||
|
||||
alter table migtest_e_history add column sys_period_start datetime(6) default now(6);
|
||||
alter table migtest_e_history add column sys_period_end datetime(6);
|
||||
alter table migtest_e_history modify test_string bigint;
|
||||
@@ -52,17 +49,13 @@ alter table migtest_e_history modify test_string bigint;
|
||||
-- NOTE: table has @History - special migration may be necessary
|
||||
update migtest_e_history2 set test_string = 'unknown' where test_string is null;
|
||||
alter table migtest_e_history2 modify test_string varchar(255) not null default 'unknown';
|
||||
|
||||
alter table migtest_e_history4 modify test_number bigint;
|
||||
alter table migtest_e_history4_history modify test_number bigint;
|
||||
|
||||
|
||||
-- NOTE: table has @History - special migration may be necessary
|
||||
update migtest_e_history6 set test_number1 = 42 where test_number1 is null;
|
||||
alter table migtest_e_history6 modify test_number1 integer not null default 42;
|
||||
alter table migtest_e_history6 modify test_number2 integer;
|
||||
|
||||
|
||||
-- apply alter tables
|
||||
alter table migtest_ckey_detail add column one_key integer;
|
||||
alter table migtest_ckey_detail add column two_key varchar(127);
|
||||
|
||||
@@ -3,19 +3,13 @@
|
||||
drop view if exists migtest_e_history2_with_history;
|
||||
-- apply changes
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'description_file');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'old_boolean2');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'eref_id');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string1');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string1');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string2');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string2');
|
||||
|
||||
-- apply post alter
|
||||
drop table if exists migtest_e_ref;
|
||||
-- apply history view
|
||||
|
||||
@@ -31,9 +31,7 @@ alter table migtest_e_basic modify status2 varchar(1) not null default 'N';
|
||||
|
||||
update migtest_e_basic set user_id = 23 where user_id is null;
|
||||
alter table migtest_e_basic modify user_id integer not null default 23;
|
||||
|
||||
alter table migtest_e_history2 modify test_string varchar(255);
|
||||
|
||||
alter table migtest_e_history4 modify test_number integer;
|
||||
alter table migtest_e_history4_history modify test_number integer;
|
||||
alter table migtest_e_history6 modify test_number1 integer;
|
||||
|
||||
@@ -9,39 +9,25 @@ drop view if exists migtest_e_history2_with_history;
|
||||
drop view if exists migtest_e_history5_with_history;
|
||||
-- apply changes
|
||||
CALL usp_ebean_drop_column('migtest_ckey_detail', 'one_key');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_ckey_detail', 'two_key');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_ckey_parent', 'assoc_id');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'new_string_field');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'new_boolean_field');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'new_boolean_field2');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'progress');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_basic', 'new_integer');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_history', 'sys_period_start');
|
||||
CALL usp_ebean_drop_column('migtest_e_history', 'sys_period_end');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2', 'test_string2');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2_history', 'test_string2');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_history2', 'test_string3');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2_history', 'test_string3');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_history2', 'new_column');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2_history', 'new_column');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_history5', 'test_boolean');
|
||||
CALL usp_ebean_drop_column('migtest_e_history5_history', 'test_boolean');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_e_softdelete', 'deleted');
|
||||
|
||||
CALL usp_ebean_drop_column('migtest_oto_child', 'master_id');
|
||||
|
||||
-- apply post alter
|
||||
drop table if exists migtest_e_user;
|
||||
drop table if exists migtest_mtm_c_migtest_mtm_m;
|
||||
|
||||
Reference in new issue
Block a user