From 4295de6b81e06574f0aff8c3e4fc2bc094307c2f Mon Sep 17 00:00:00 2001 From: taktos9 Date: Sat, 25 Oct 2008 06:19:40 +0000 Subject: [PATCH] =?utf8?q?dist=E7=94=A8=E3=83=91=E3=83=83=E3=82=B1?= =?utf8?q?=E3=83=BC=E3=82=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/ea2ddl/trunk/ea2ddl@56 136db618-7844-41ca-8ac1-fb3fd040db1d --- ea2ddl-parent/build.xml | 41 ++++++++++++++++++ ea2ddl-parent/dist/ea2ddl/build-ea2ddl.xml | 39 ++++++++++++++++++ ea2ddl-parent/dist/ea2ddl/config/ea2ddl.properties | 2 + ea2ddl-parent/dist/ea2ddl/config/jdbc.dicon | 48 ++++++++++++++++++++++ .../dist/ea2ddl/templates/classification.ftl | 4 ++ ea2ddl-parent/dist/ea2ddl/templates/ddl.ftl | 45 ++++++++++++++++++++ 6 files changed, 179 insertions(+) create mode 100644 ea2ddl-parent/build.xml create mode 100644 ea2ddl-parent/dist/ea2ddl/build-ea2ddl.xml create mode 100644 ea2ddl-parent/dist/ea2ddl/config/ea2ddl.properties create mode 100644 ea2ddl-parent/dist/ea2ddl/config/jdbc.dicon create mode 100644 ea2ddl-parent/dist/ea2ddl/templates/classification.ftl create mode 100644 ea2ddl-parent/dist/ea2ddl/templates/ddl.ftl diff --git a/ea2ddl-parent/build.xml b/ea2ddl-parent/build.xml new file mode 100644 index 0000000..b656286 --- /dev/null +++ b/ea2ddl-parent/build.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ea2ddl-parent/dist/ea2ddl/build-ea2ddl.xml b/ea2ddl-parent/dist/ea2ddl/build-ea2ddl.xml new file mode 100644 index 0000000..d462499 --- /dev/null +++ b/ea2ddl-parent/dist/ea2ddl/build-ea2ddl.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ea2ddl-parent/dist/ea2ddl/config/ea2ddl.properties b/ea2ddl-parent/dist/ea2ddl/config/ea2ddl.properties new file mode 100644 index 0000000..70f4aa1 --- /dev/null +++ b/ea2ddl-parent/dist/ea2ddl/config/ea2ddl.properties @@ -0,0 +1,2 @@ +er.package.tree=\u30d3\u30e5\u30fc/\u30af\u30e9\u30b9\u30d3\u30e5\u30fc/ER\u56f3/EXAMPLEDB +use.schema=false \ No newline at end of file diff --git a/ea2ddl-parent/dist/ea2ddl/config/jdbc.dicon b/ea2ddl-parent/dist/ea2ddl/config/jdbc.dicon new file mode 100644 index 0000000..0d07484 --- /dev/null +++ b/ea2ddl-parent/dist/ea2ddl/config/jdbc.dicon @@ -0,0 +1,48 @@ + + + + + + + + + "sun.jdbc.odbc.JdbcOdbcDriver" + + + "jdbc:odbc:exampledb" + + "sa" + "" + + "charSet" + "MS932" + + + + + 600 + 10 + true + + + + + + + + + + \ No newline at end of file diff --git a/ea2ddl-parent/dist/ea2ddl/templates/classification.ftl b/ea2ddl-parent/dist/ea2ddl/templates/classification.ftl new file mode 100644 index 0000000..4ba0f71 --- /dev/null +++ b/ea2ddl-parent/dist/ea2ddl/templates/classification.ftl @@ -0,0 +1,4 @@ +<#list classificationList as cls> +${cls} + + \ No newline at end of file diff --git a/ea2ddl-parent/dist/ea2ddl/templates/ddl.ftl b/ea2ddl-parent/dist/ea2ddl/templates/ddl.ftl new file mode 100644 index 0000000..72da61f --- /dev/null +++ b/ea2ddl-parent/dist/ea2ddl/templates/ddl.ftl @@ -0,0 +1,45 @@ +<#comment> +<#list tableList as table> +<#list table.foreignKeyList as fk>ALTER TABLE ${table.name} DROP CONSTRAINT ${fk.name} +; + + +<#list tableList as table> +DROP TABLE ${table.name}; + + + +<#list tableList as table> +CREATE TABLE ${table.name} ( +<#list table.columnList as column> ${column.name} ${column.definition}<#if column_has_next>, + +) +; +<#if table.primaryKey??>ALTER TABLE ${table.name} ADD CONSTRAINT ${table.primaryKey.name} + PRIMARY KEY (<#list table.primaryKey.columnNameList as columnName>${columnName}<#if columnName_has_next>,) +; + +<#list table.uniqueList as unique>ALTER TABLE ${table.name} ADD CONSTRAINT ${unique.name} + UNIQUE (<#list unique.columnNameList as columnName>${columnName}<#if columnName_has_next>,) +; + +<#if table.alias?? || table.note??> +COMMENT ON TABLE ${table.name} IS '<#if table.alias??>${table.alias}:<#if table.note??>${table.note}' +; + +<#list table.columnList as column> +<#if column.alias?? || column.note??> +COMMENT ON COLUMN ${table.name}.${column.name} IS '<#if column.alias??>${column.alias}:<#if column.note??>${column.note}' +; + + + + + +<#list tableList as table> +<#list table.foreignKeyList as fk>ALTER TABLE ${table.name} ADD CONSTRAINT ${fk.name} + FOREIGN KEY (<#list fk.columnNameList as columnName>${columnName}<#if columnName_has_next>,) + REFERENCES ${fk.targetTable} (<#list fk.targetColumnNameList as columnName>${columnName}<#if columnName_has_next>,) +; + + \ No newline at end of file -- 2.11.0