mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-23 15:12:58 +00:00
#374 - Update example/sample xml for xml schema changes
This commit is contained in:
1 parent
f6c3279e86
commit
c0d4dac2b3
8 files changed
+240
-5
No files matched your search
@@ -0,0 +1,60 @@
|
||||
<?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" generated="true">
|
||||
|
||||
<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="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">
|
||||
|
||||
<dropColumn columnName="fooe" tableName="hello_world"/>
|
||||
|
||||
</changeSet>
|
||||
|
||||
</migration>
|
||||
+7
-2
@@ -2,7 +2,7 @@
|
||||
<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 id="1">
|
||||
<changeSet type="apply">
|
||||
|
||||
<sql>
|
||||
<apply>
|
||||
@@ -44,7 +44,6 @@
|
||||
<column name="fooe" type="varchar(20)"/>
|
||||
</addColumn>
|
||||
|
||||
<dropColumn columnName="fooe" tableName="hello_world"/>
|
||||
|
||||
<createHistoryTable baseTable="hello_world"/>
|
||||
|
||||
@@ -52,4 +51,10 @@
|
||||
|
||||
</changeSet>
|
||||
|
||||
<changeSet type="drop" generated="true">
|
||||
|
||||
<dropColumn columnName="fooe" tableName="hello_world"/>
|
||||
|
||||
</changeSet>
|
||||
|
||||
</migration>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?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>
|
||||
+5
-1
@@ -2,7 +2,7 @@
|
||||
<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 id="1">
|
||||
<changeSet type="apply">
|
||||
|
||||
<sql>
|
||||
<apply>
|
||||
@@ -48,4 +48,8 @@
|
||||
|
||||
</changeSet>
|
||||
|
||||
<changeSet type="drop" generated="true">
|
||||
<!-- no drops to do -->
|
||||
</changeSet>
|
||||
|
||||
</migration>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
|
||||
|
||||
<changeSet type="baseline">
|
||||
|
||||
<createTable name="mig_country">
|
||||
<column name="code" type="varchar(2)" primaryKey="true" />
|
||||
<column name="name" type="varchar(255)"/>
|
||||
<column name="longName" type="varchar(1000)"/>
|
||||
</createTable>
|
||||
|
||||
</changeSet>
|
||||
|
||||
<changeSet type="drop" generated="true">
|
||||
<!-- no drops to do -->
|
||||
</changeSet>
|
||||
|
||||
</migration>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<migration xmlns="http://ebean-orm.github.io/xml/ns/dbmigration">
|
||||
|
||||
<changeSet type="apply" generated="true">
|
||||
|
||||
<createTable name="mig_account">
|
||||
<column name="id" type="bigint" primaryKey="true" identity="true"/>
|
||||
<column name="name" type="varchar(255)"/>
|
||||
<column name="when_created" type="timestamp" notnull="true" />
|
||||
<column name="when_modified" type="timestamp" notnull="true" />
|
||||
<column name="version" type="bigint" notnull="true" />
|
||||
</createTable>
|
||||
|
||||
<createTable name="mig_address" withHistory="true">
|
||||
<column name="id" type="integer" primaryKey="true" identity="true"/>
|
||||
<column name="line_1" type="varchar(100)"/>
|
||||
<column name="line_2" type="varchar(100)"/>
|
||||
<column name="city" type="varchar(100)"/>
|
||||
<column name="country_code" type="varchar(2)" references="o_country.code" />
|
||||
<column name="when_created" type="timestamp" notnull="true"/>
|
||||
<column name="when_updated" type="timestamp" notnull="true"/>
|
||||
<column name="version" type="bigint" notnull="true"/>
|
||||
</createTable>
|
||||
|
||||
<addColumn tableName="mig_country">
|
||||
<column name="status" type="varchar(5)"/>
|
||||
</addColumn>
|
||||
|
||||
<createHistoryTable baseTable="mig_country" whenCreatedColumn="when_created"/>
|
||||
|
||||
</changeSet>
|
||||
|
||||
|
||||
<changeSet type="drop" generated="true">
|
||||
|
||||
<dropColumn columnName="longName" tableName="mig_address"/>
|
||||
|
||||
</changeSet>
|
||||
|
||||
</migration>
|
||||
Reference in new issue
Block a user