-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#374 - Update example/sample xml for xml schema changes
- Loading branch information
Showing
8 changed files
with
240 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |