mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
WIP: Db migration alterColumn ...
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
</rollback>
|
||||
</sql>
|
||||
|
||||
<createTable name="dbmigration">
|
||||
<createTable name="v10_table">
|
||||
<column name="application" type="varchar(30)" notnull="true"/>
|
||||
<column name="change_log" type="integer" notnull="true"/>
|
||||
<column name="change_set" type="integer" notnull="true"/>
|
||||
@@ -21,17 +21,6 @@
|
||||
<column name="locked_at" type="timestamp"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="dbmigration_changeset">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="application" type="varchar(30)" notnull="true" references="dbmigration.application"/>
|
||||
<column name="change_log" type="integer" notnull="true"/>
|
||||
<column name="change_set" type="integer" notnull="true"/>
|
||||
<column name="run_at" type="timestamp" notnull="true"/>
|
||||
<column name="run_by" type="varchar(30)" notnull="true"/>
|
||||
<column name="run_ddl" type="clob"/>
|
||||
<column name="run_log" type="clob"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="hello_world" withHistory="true">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="name" type="varchar(20)" notnull="true"/>
|
||||
@@ -47,7 +36,7 @@
|
||||
|
||||
<createHistoryTable baseTable="hello_world"/>
|
||||
|
||||
<addForeignKey name="fk_hello_world_x" columns="x" references="asdsad.asd"/>
|
||||
<!--<addForeignKey name="fk_hello_world_x" columns="x" references="asdsad.asd"/>-->
|
||||
|
||||
</changeSet>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</rollback>
|
||||
</sql>
|
||||
|
||||
<createTable name="dbmigration">
|
||||
<createTable name="v11_table">
|
||||
<column name="application" type="varchar(30)" notnull="true"/>
|
||||
<column name="change_log" type="integer" notnull="true"/>
|
||||
<column name="change_set" type="integer" notnull="true"/>
|
||||
@@ -21,34 +21,6 @@
|
||||
<column name="locked_at" type="timestamp"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="dbmigration_changeset">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="application" type="varchar(30)" notnull="true" references="dbmigration.application"/>
|
||||
<column name="change_log" type="integer" notnull="true"/>
|
||||
<column name="change_set" type="integer" notnull="true"/>
|
||||
<column name="run_at" type="timestamp" notnull="true"/>
|
||||
<column name="run_by" type="varchar(30)" notnull="true"/>
|
||||
<column name="run_ddl" type="clob"/>
|
||||
<column name="run_log" type="clob"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="hello_world" withHistory="true">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="name" type="varchar(20)" notnull="true"/>
|
||||
<column name="type" type="varchar(20)" notnull="true"/>
|
||||
<column name="description" type="varchar(20)" notnull="true"/>
|
||||
<uniqueConstraint columnNames="name,type"/>
|
||||
</createTable>
|
||||
|
||||
<addColumn tableName="hello_world">
|
||||
<column name="fooe" type="varchar(20)"/>
|
||||
</addColumn>
|
||||
|
||||
|
||||
<createHistoryTable baseTable="hello_world"/>
|
||||
|
||||
<addForeignKey name="fk_hello_world_x" columns="x" references="asdsad.asd"/>
|
||||
|
||||
</changeSet>
|
||||
|
||||
<changeSet type="drop" generated="true">
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ebean-orm.github.io/xml/ns/dbmigration http://ebean-orm.github.io/xml/ns/dbmigration-1.0.xsd">
|
||||
|
||||
<changeSet type="apply">
|
||||
|
||||
<sql>
|
||||
<apply>
|
||||
create table foo;
|
||||
</apply>
|
||||
<rollback>
|
||||
drop table if exists foo;
|
||||
</rollback>
|
||||
</sql>
|
||||
|
||||
<createTable name="dbmigration_lock">
|
||||
<column name="application" type="varchar(30)" notnull="true"/>
|
||||
<column name="locked_by" type="varchar(30)"/>
|
||||
<column name="locked_at" type="timestamp"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="dbmigration_run">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="application" type="varchar(30)" notnull="true" references="dbmigration.application"/>
|
||||
<column name="version" type="varchar(3)" notnull="true"/>
|
||||
<column name="run_at" type="timestamp" notnull="true"/>
|
||||
<column name="run_by" type="varchar(30)" notnull="true"/>
|
||||
<column name="run_status" type="varchar(30)" notnull="true"/>
|
||||
<column name="run_ddl" type="clob"/>
|
||||
<column name="run_log" type="clob"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="hello_world" withHistory="true">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="name" type="varchar(20)" notnull="true"/>
|
||||
<column name="description" type="varchar(20)" notnull="true"/>
|
||||
</createTable>
|
||||
|
||||
<addColumn tableName="hello_world">
|
||||
<column name="fooe" type="varchar(20)"/>
|
||||
</addColumn>
|
||||
|
||||
<dropColumn columnName="fooe" tableName="hello_world"/>
|
||||
|
||||
<createHistoryTable baseTable="hello_world"/>
|
||||
|
||||
</changeSet>
|
||||
|
||||
<changeSet type="drop" generated="true">
|
||||
<!-- no drops to do -->
|
||||
</changeSet>
|
||||
|
||||
</migration>
|
||||
@@ -13,39 +13,6 @@
|
||||
</rollback>
|
||||
</sql>
|
||||
|
||||
<createTable name="dbmigration">
|
||||
<column name="application" type="varchar(30)" notnull="true"/>
|
||||
<column name="change_log" type="integer" notnull="true"/>
|
||||
<column name="change_set" type="integer" notnull="true"/>
|
||||
<column name="locked_by" type="varchar(30)"/>
|
||||
<column name="locked_at" type="timestamp"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="dbmigration_changeset">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="application" type="varchar(30)" notnull="true" references="dbmigration.application"/>
|
||||
<column name="change_log" type="integer" notnull="true"/>
|
||||
<column name="change_set" type="integer" notnull="true"/>
|
||||
<column name="run_at" type="timestamp" notnull="true"/>
|
||||
<column name="run_by" type="varchar(30)" notnull="true"/>
|
||||
<column name="run_ddl" type="clob"/>
|
||||
<column name="run_log" type="clob"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="hello_world" withHistory="true">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="name" type="varchar(20)" notnull="true"/>
|
||||
<column name="description" type="varchar(20)" notnull="true"/>
|
||||
</createTable>
|
||||
|
||||
<addColumn tableName="hello_world">
|
||||
<column name="fooe" type="varchar(20)"/>
|
||||
</addColumn>
|
||||
|
||||
<dropColumn columnName="fooe" tableName="hello_world"/>
|
||||
|
||||
<createHistoryTable baseTable="hello_world"/>
|
||||
|
||||
</changeSet>
|
||||
|
||||
<changeSet type="drop" generated="true">
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ebean-orm.github.io/xml/ns/dbmigration http://ebean-orm.github.io/xml/ns/dbmigration-1.0.xsd">
|
||||
|
||||
<changeSet type="apply">
|
||||
|
||||
<sql>
|
||||
<apply>
|
||||
create table foo;
|
||||
</apply>
|
||||
<rollback>
|
||||
drop table if exists foo;
|
||||
</rollback>
|
||||
</sql>
|
||||
|
||||
<createTable name="dbmigration">
|
||||
<column name="application" type="varchar(30)" notnull="true"/>
|
||||
<column name="change_log" type="integer" notnull="true"/>
|
||||
<column name="change_set" type="integer" notnull="true"/>
|
||||
<column name="locked_by" type="varchar(30)"/>
|
||||
<column name="locked_at" type="timestamp"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="dbmigration_changeset">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="application" type="varchar(30)" notnull="true" references="dbmigration.application"/>
|
||||
<column name="change_log" type="integer" notnull="true"/>
|
||||
<column name="change_set" type="integer" notnull="true"/>
|
||||
<column name="run_at" type="timestamp" notnull="true"/>
|
||||
<column name="run_by" type="varchar(30)" notnull="true"/>
|
||||
<column name="run_ddl" type="clob"/>
|
||||
<column name="run_log" type="clob"/>
|
||||
</createTable>
|
||||
|
||||
<createTable name="hello_world" withHistory="true">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="name" type="varchar(20)" notnull="true"/>
|
||||
<column name="description" type="varchar(20)" notnull="true"/>
|
||||
</createTable>
|
||||
|
||||
<addColumn tableName="hello_world">
|
||||
<column name="fooe" type="varchar(20)"/>
|
||||
</addColumn>
|
||||
|
||||
<dropColumn columnName="fooe" tableName="hello_world"/>
|
||||
|
||||
<createHistoryTable baseTable="hello_world"/>
|
||||
|
||||
</changeSet>
|
||||
|
||||
<changeSet type="drop" generated="true">
|
||||
<!-- no drops to do -->
|
||||
</changeSet>
|
||||
|
||||
</migration>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<applications xmlns="http://ebean-orm.github.io/xml/ns/dbmigration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://ebean-orm.github.io/xml/ns/dbmigration http://ebean-orm.github.io/xml/ns/dbmigration-1.0.xsd">
|
||||
|
||||
<application name="myapp" resourcePath="dbmigration/app1"/>
|
||||
|
||||
</applications>
|
||||
Reference in New Issue
Block a user