diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-03-26 13:03:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-10 18:46:46 +0200 |
commit | a8dfcfcff2534695ae19015fd33cb26fd2fb88c6 (patch) | |
tree | dee11b6c915aa42f694b0b06e4342f5c427b8212 | |
parent | 15c6024da6a15e2d6e3302e4df375092959edbe2 (diff) |
Add changelog support for add, drop, and later column
34 files changed, 481 insertions, 1 deletions
diff --git a/common/changelog/add-column-mssql-diff.xml b/common/changelog/add-column-mssql-diff.xml new file mode 100644 index 0000000..7485d9c --- /dev/null +++ b/common/changelog/add-column-mssql-diff.xml @@ -0,0 +1,16 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <add-column name="num" type="INT" null="false"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-mssql-patch.xml b/common/changelog/add-column-mssql-patch.xml new file mode 100644 index 0000000..44de8f2 --- /dev/null +++ b/common/changelog/add-column-mssql-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <column name="num" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-mysql-diff.xml b/common/changelog/add-column-mysql-diff.xml new file mode 100644 index 0000000..7485d9c --- /dev/null +++ b/common/changelog/add-column-mysql-diff.xml @@ -0,0 +1,16 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <add-column name="num" type="INT" null="false"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-mysql-patch.xml b/common/changelog/add-column-mysql-patch.xml new file mode 100644 index 0000000..44de8f2 --- /dev/null +++ b/common/changelog/add-column-mysql-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <column name="num" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-oracle-diff.xml b/common/changelog/add-column-oracle-diff.xml new file mode 100644 index 0000000..cbd2451 --- /dev/null +++ b/common/changelog/add-column-oracle-diff.xml @@ -0,0 +1,16 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <add-column name="num" type="NUMBER(10)" null="false"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="NUMBER(10)" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-oracle-patch.xml b/common/changelog/add-column-oracle-patch.xml new file mode 100644 index 0000000..a517a59 --- /dev/null +++ b/common/changelog/add-column-oracle-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="NUMBER(10)" null="false"/> + <column name="num" type="NUMBER(10)" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-pgsql-diff.xml b/common/changelog/add-column-pgsql-diff.xml new file mode 100644 index 0000000..f19e9e9 --- /dev/null +++ b/common/changelog/add-column-pgsql-diff.xml @@ -0,0 +1,16 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <add-column name="num" type="INTEGER" null="false"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-pgsql-patch.xml b/common/changelog/add-column-pgsql-patch.xml new file mode 100644 index 0000000..10958e6 --- /dev/null +++ b/common/changelog/add-column-pgsql-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <column name="num" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-sqlite-diff.xml b/common/changelog/add-column-sqlite-diff.xml new file mode 100644 index 0000000..f19e9e9 --- /dev/null +++ b/common/changelog/add-column-sqlite-diff.xml @@ -0,0 +1,16 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <add-column name="num" type="INTEGER" null="false"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column-sqlite-patch.xml b/common/changelog/add-column-sqlite-patch.xml new file mode 100644 index 0000000..10958e6 --- /dev/null +++ b/common/changelog/add-column-sqlite-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <column name="num" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx new file mode 100644 index 0000000..b185ad9 --- /dev/null +++ b/common/changelog/add-column.hxx @@ -0,0 +1,21 @@ +// file : common/changelog/add-column.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_COLUMN_HXX +#define ADD_COLUMN_HXX + +#pragma db model version(BVER, CVER, true) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER > 1 + int num; +#endif +}; + +#endif // ADD_COLUMN_HXX diff --git a/common/changelog/alter-column-mssql-diff.xml b/common/changelog/alter-column-mssql-diff.xml new file mode 100644 index 0000000..907fb8d --- /dev/null +++ b/common/changelog/alter-column-mssql-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <alter-column name="num" null="true"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <column name="num" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-mssql-patch.xml b/common/changelog/alter-column-mssql-patch.xml new file mode 100644 index 0000000..a1d25da --- /dev/null +++ b/common/changelog/alter-column-mssql-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <column name="num" type="INT" null="true"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-mysql-diff.xml b/common/changelog/alter-column-mysql-diff.xml new file mode 100644 index 0000000..907fb8d --- /dev/null +++ b/common/changelog/alter-column-mysql-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <alter-column name="num" null="true"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <column name="num" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-mysql-patch.xml b/common/changelog/alter-column-mysql-patch.xml new file mode 100644 index 0000000..a1d25da --- /dev/null +++ b/common/changelog/alter-column-mysql-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <column name="num" type="INT" null="true"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-oracle-diff.xml b/common/changelog/alter-column-oracle-diff.xml new file mode 100644 index 0000000..4a2b0df --- /dev/null +++ b/common/changelog/alter-column-oracle-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <alter-column name="num" null="true"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="NUMBER(10)" null="false"/> + <column name="num" type="NUMBER(10)" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-oracle-patch.xml b/common/changelog/alter-column-oracle-patch.xml new file mode 100644 index 0000000..2245880 --- /dev/null +++ b/common/changelog/alter-column-oracle-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="NUMBER(10)" null="false"/> + <column name="num" type="NUMBER(10)" null="true"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-pgsql-diff.xml b/common/changelog/alter-column-pgsql-diff.xml new file mode 100644 index 0000000..0027190 --- /dev/null +++ b/common/changelog/alter-column-pgsql-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <alter-column name="num" null="true"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <column name="num" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-pgsql-patch.xml b/common/changelog/alter-column-pgsql-patch.xml new file mode 100644 index 0000000..dd954ad --- /dev/null +++ b/common/changelog/alter-column-pgsql-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <column name="num" type="INTEGER" null="true"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-sqlite-diff.xml b/common/changelog/alter-column-sqlite-diff.xml new file mode 100644 index 0000000..0027190 --- /dev/null +++ b/common/changelog/alter-column-sqlite-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <alter-column name="num" null="true"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <column name="num" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column-sqlite-patch.xml b/common/changelog/alter-column-sqlite-patch.xml new file mode 100644 index 0000000..dd954ad --- /dev/null +++ b/common/changelog/alter-column-sqlite-patch.xml @@ -0,0 +1,11 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <column name="num" type="INTEGER" null="true"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx new file mode 100644 index 0000000..769553b --- /dev/null +++ b/common/changelog/alter-column.hxx @@ -0,0 +1,22 @@ +// file : common/changelog/alter-column.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ALTER_COLUMN_HXX +#define ALTER_COLUMN_HXX + +#pragma db model version(BVER, CVER, true) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER > 1 + #pragma db null +#endif + int num; +}; + +#endif // ALTER_COLUMN_HXX diff --git a/common/changelog/drop-column-mssql-diff.xml b/common/changelog/drop-column-mssql-diff.xml new file mode 100644 index 0000000..496f8c7 --- /dev/null +++ b/common/changelog/drop-column-mssql-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <drop-column name="num"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <column name="num" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-mssql-patch.xml b/common/changelog/drop-column-mssql-patch.xml new file mode 100644 index 0000000..1a38c38 --- /dev/null +++ b/common/changelog/drop-column-mssql-patch.xml @@ -0,0 +1,10 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-mysql-diff.xml b/common/changelog/drop-column-mysql-diff.xml new file mode 100644 index 0000000..496f8c7 --- /dev/null +++ b/common/changelog/drop-column-mysql-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <drop-column name="num"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <column name="num" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-mysql-patch.xml b/common/changelog/drop-column-mysql-patch.xml new file mode 100644 index 0000000..1a38c38 --- /dev/null +++ b/common/changelog/drop-column-mysql-patch.xml @@ -0,0 +1,10 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INT" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-oracle-diff.xml b/common/changelog/drop-column-oracle-diff.xml new file mode 100644 index 0000000..00b8394 --- /dev/null +++ b/common/changelog/drop-column-oracle-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <drop-column name="num"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="NUMBER(10)" null="false"/> + <column name="num" type="NUMBER(10)" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-oracle-patch.xml b/common/changelog/drop-column-oracle-patch.xml new file mode 100644 index 0000000..a53c3aa --- /dev/null +++ b/common/changelog/drop-column-oracle-patch.xml @@ -0,0 +1,10 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="NUMBER(10)" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-pgsql-diff.xml b/common/changelog/drop-column-pgsql-diff.xml new file mode 100644 index 0000000..ae2e6b9 --- /dev/null +++ b/common/changelog/drop-column-pgsql-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <drop-column name="num"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <column name="num" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-pgsql-patch.xml b/common/changelog/drop-column-pgsql-patch.xml new file mode 100644 index 0000000..8f19f4b --- /dev/null +++ b/common/changelog/drop-column-pgsql-patch.xml @@ -0,0 +1,10 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-sqlite-diff.xml b/common/changelog/drop-column-sqlite-diff.xml new file mode 100644 index 0000000..ae2e6b9 --- /dev/null +++ b/common/changelog/drop-column-sqlite-diff.xml @@ -0,0 +1,17 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <changeset version="2"> + <alter-table name="object"> + <drop-column name="num"/> + </alter-table> + </changeset> + + <model version="1"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <column name="num" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column-sqlite-patch.xml b/common/changelog/drop-column-sqlite-patch.xml new file mode 100644 index 0000000..8f19f4b --- /dev/null +++ b/common/changelog/drop-column-sqlite-patch.xml @@ -0,0 +1,10 @@ +<changelog xmlns="http://www.codesynthesis.com/xmlns/odb/changelog" version="1"> + <model version="2"> + <table name="object"> + <column name="id" type="INTEGER" null="false"/> + <primary-key auto="true"> + <column name="id"/> + </primary-key> + </table> + </model> +</changelog> diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx new file mode 100644 index 0000000..70fbcba --- /dev/null +++ b/common/changelog/drop-column.hxx @@ -0,0 +1,21 @@ +// file : common/changelog/drop-column.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_COLUMN_HXX +#define DROP_COLUMN_HXX + +#pragma db model version(BVER, CVER, true) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER == 1 + int num; +#endif +}; + +#endif // DROP_COLUMN_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile index 0819616..1349509 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -4,7 +4,13 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -odb_hdr := model.hxx add-table.hxx drop-table.hxx +odb_hdr := \ +model.hxx \ +add-table.hxx \ +drop-table.hxx \ +add-column.hxx \ +drop-column.hxx \ +alter-column.hxx common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options |