regenerated migration scripts

This commit is contained in:
Roland Praml
2022-02-03 08:02:08 +01:00
parent 5b53430085
commit f83e204b22
119 changed files with 177 additions and 85 deletions
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
<changeSet type="apply">
<createTable name="migtest_e_basic" pkName="pk_migtest_e_basic">
<column name="id" type="integer" primaryKey="true"/>
<column name="status" type="varchar(1)" checkConstraint="check ( status in ('N','A','I'))" checkConstraintName="ck_migtest_e_basic_status"/>
<column name="status2" type="varchar(1)" defaultValue="'N'" notnull="true" checkConstraint="check ( status2 in ('N','A','I'))" checkConstraintName="ck_migtest_e_basic_status2"/>
<column name="name" type="varchar(127)"/>
<column name="description" type="varchar(127)"/>
</createTable>
</changeSet>
</migration>
@@ -1,11 +0,0 @@
-- Migrationscripts for ebean unittest
-- apply changes
create table migtest_e_basic (
id integer auto_increment not null,
status varchar(1),
status2 varchar(1) default 'N' not null,
name varchar(127),
description varchar(127),
constraint pk_migtest_e_basic primary key (id)
);
@@ -1,6 +0,0 @@
-- Migrationscripts for ebean unittest
-- apply changes
CALL usp_ebean_drop_column('migtest_e_basic', 'status2');
CALL usp_ebean_drop_column('migtest_e_basic', 'description');
@@ -1,48 +0,0 @@
-- Inital script to create stored procedures etc for mysql platform
DROP PROCEDURE IF EXISTS usp_ebean_drop_foreign_keys;
delimiter $$
--
-- PROCEDURE: usp_ebean_drop_foreign_keys TABLE, COLUMN
-- deletes all constraints and foreign keys referring to TABLE.COLUMN
--
CREATE PROCEDURE usp_ebean_drop_foreign_keys(IN p_table_name VARCHAR(255), IN p_column_name VARCHAR(255))
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE c_fk_name CHAR(255);
DECLARE curs CURSOR FOR SELECT CONSTRAINT_NAME from information_schema.KEY_COLUMN_USAGE
WHERE TABLE_SCHEMA = DATABASE() and TABLE_NAME = p_table_name and COLUMN_NAME = p_column_name
AND REFERENCED_TABLE_NAME IS NOT NULL;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN curs;
read_loop: LOOP
FETCH curs INTO c_fk_name;
IF done THEN
LEAVE read_loop;
END IF;
SET @sql = CONCAT('ALTER TABLE ', p_table_name, ' DROP FOREIGN KEY ', c_fk_name);
PREPARE stmt FROM @sql;
EXECUTE stmt;
END LOOP;
CLOSE curs;
END
$$
DROP PROCEDURE IF EXISTS usp_ebean_drop_column;
delimiter $$
--
-- PROCEDURE: usp_ebean_drop_column TABLE, COLUMN
-- deletes the column and ensures that all indices and constraints are dropped first
--
CREATE PROCEDURE usp_ebean_drop_column(IN p_table_name VARCHAR(255), IN p_column_name VARCHAR(255))
BEGIN
CALL usp_ebean_drop_foreign_keys(p_table_name, p_column_name);
SET @sql = CONCAT('ALTER TABLE ', p_table_name, ' DROP COLUMN ', p_column_name);
PREPARE stmt FROM @sql;
EXECUTE stmt;
END
$$
@@ -1,4 +0,0 @@
1835064798, I__create_procs.sql
1968521526, 1.0__initial.sql
-728933533, 1.2__dropsFor_1.1.sql
@@ -0,0 +1,3 @@
-- h2 and postgres script
@@ -0,0 +1,7 @@
create or replace view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id
@@ -0,0 +1,17 @@
-- Migrationscripts for ebean unittest DbMigrationDropHistoryTest
-- apply changes
create table migtest_e_history7 (
id integer generated by default as identity not null,
constraint pk_migtest_e_history7 primary key (id)
);
alter table migtest_e_history7 add column sys_period_start timestamp default now();
alter table migtest_e_history7 add column sys_period_end timestamp;
create table migtest_e_history7_history(
id integer,
sys_period_start timestamp,
sys_period_end timestamp
);
create view migtest_e_history7_with_history as select * from migtest_e_history7 union all select * from migtest_e_history7_history;
create trigger migtest_e_history7_history_upd before update,delete on migtest_e_history7 for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
@@ -0,0 +1,10 @@
-- Migrationscripts for ebean unittest DbMigrationDropHistoryTest
-- drop dependencies
drop trigger migtest_e_history7_history_upd;
drop view migtest_e_history7_with_history;
alter table migtest_e_history7 drop column sys_period_start;
alter table migtest_e_history7 drop column sys_period_end;
drop table migtest_e_history7_history;
-- apply changes
@@ -0,0 +1,3 @@
-- h2 and postgres script
@@ -0,0 +1,7 @@
create or replace view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
<changeSet type="apply">
<createTable name="migtest_e_history7" withHistory="true" pkName="pk_migtest_e_history7">
<column name="id" type="integer" primaryKey="true"/>
</createTable>
</changeSet>
</migration>
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
<changeSet type="pendingDrops">
<dropColumn columnName="status2" tableName="migtest_e_basic"/>
<dropColumn columnName="description" tableName="migtest_e_basic"/>
<dropHistoryTable baseTable="migtest_e_history7"/>
</changeSet>
</migration>
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
<changeSet type="apply" dropsFor="1.1">
<dropColumn columnName="status2" tableName="migtest_e_basic"/>
<dropColumn columnName="description" tableName="migtest_e_basic"/>
<dropHistoryTable baseTable="migtest_e_history7"/>
</changeSet>
</migration>
@@ -0,0 +1,7 @@
create or replace view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id
@@ -1,4 +1,5 @@
1835064798, I__create_procs.sql
1968521526, 1.0__initial.sql
-728933533, 1.2__dropsFor_1.1.sql
561281075, R__order_views.sql
@@ -0,0 +1,8 @@
delimiter $$
BEGIN
IF NOT EXISTS (SELECT * FROM SYSCAT.TABLES WHERE TABSCHEMA = CURRENT SCHEMA AND TABNAME = 'EXPLAIN_STREAM') THEN
call SYSPROC.SYSINSTALLOBJECTS( 'EXPLAIN', 'C' , '', CURRENT SCHEMA );
END IF;
END;$$
@@ -0,0 +1,7 @@
create or replace view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id
@@ -3,4 +3,6 @@
1091886546, 1.2__dropsFor_1.1.sql
-1041850370, 1.3.sql
1293885677, 1.4__dropsFor_1.3.sql
-133543359, R__db2_explain_tables.sql
561281075, R__order_views.sql
@@ -0,0 +1,3 @@
-- h2 and postgres script
@@ -0,0 +1,7 @@
create or replace view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id
@@ -3,4 +3,6 @@
1616986842, 1.2__dropsFor_1.1.sql
-1513154593, 1.3.sql
1549130952, 1.4__dropsFor_1.3.sql
783227075, R__multi_comments.sql
561281075, R__order_views.sql
@@ -0,0 +1,7 @@
create view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id;
@@ -3,4 +3,5 @@
562867593, 1.2__dropsFor_1.1.sql
1566488731, 1.3.sql
201970227, 1.4__dropsFor_1.3.sql
1906063401, R__order_views_hana.sql
@@ -0,0 +1,8 @@
drop view order_agg_vw if exists ;
create view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id;
@@ -3,4 +3,5 @@
-1462014216, 1.2__dropsFor_1.1.sql
-2039573992, 1.3.sql
-1763496614, 1.4__dropsFor_1.3.sql
861001272, R__order_views_hsqldb.sql
@@ -0,0 +1,7 @@
create or replace view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id
@@ -3,4 +3,5 @@
1029390755, 1.2__dropsFor_1.1.sql
-380371830, 1.3.sql
-724776884, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
@@ -0,0 +1,7 @@
create or replace view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id
@@ -3,4 +3,5 @@
1029390755, 1.2__dropsFor_1.1.sql
-380371830, 1.3.sql
-724776884, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
@@ -0,0 +1,4 @@
-- oracle only script
select * from dual;
@@ -0,0 +1,7 @@
create or replace view order_agg_vw as
select d.order_id, sum(d.order_qty * d.unit_price) as order_total,
sum(d.ship_qty * d.unit_price) as ship_total
from o_order_detail d
group by d.order_id
@@ -3,4 +3,6 @@
238598298, 1.2__dropsFor_1.1.sql
483114276, 1.3.sql
-629809805, 1.4__dropsFor_1.3.sql
1357801733, R__oracle_only_views.sql
561281075, R__order_views.sql

Some files were not shown because too many files have changed in this diff Show More