# HG changeset patch # User Tomas Zeman # Date 1328863987 -3600 # Node ID 2fb331324cd9e01fb610c3e2d69464ec47c8a8b1 # Parent 43fa65f5072e75ca3c11a796ba976cc42c8ad1ca DB schema dumper/tester diff -r 43fa65f5072e -r 2fb331324cd9 src/main/scala/fis/top/model/FisDbSchema.scala --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/scala/fis/top/model/FisDbSchema.scala Fri Feb 10 09:53:07 2012 +0100 @@ -0,0 +1,28 @@ +/* + * Copyright 2011 Tomas Zeman + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package fis.top.model + +import fis.base.model.BaseSchema +import fis.crm.model.CrmSchema +import fis.geo.model.GeoSchema + +trait FisDbSchema extends BaseSchema + with CrmSchema + with GeoSchema + +object FisDbSchema extends FisDbSchema + +// vim: set ts=2 sw=2 et: diff -r 43fa65f5072e -r 2fb331324cd9 src/test/scala/fis/top/model/FisDbSchemaSpec.scala --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/scala/fis/top/model/FisDbSchemaSpec.scala Fri Feb 10 09:53:07 2012 +0100 @@ -0,0 +1,38 @@ +/* + * Copyright 2011 Tomas Zeman + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package fis.top.model + +import fis.base.model._ +import java.io._ + +class FisDbSchemaSpec extends AbstractTest { + + "FisDbSchema" should "create" in { doInDB { + schema.dropAndCreate + }} + + it should "generate schema definition" in { + val f = new File("target/fis-db-schema.sql") + val pw = new PrintWriter(f) + schema.printDdl(pw) + pw.flush + pw.close + } + + object schema extends FisDbSchema with DropAndCreate +} + +// vim: set ts=2 sw=2 et: