diff options
Diffstat (limited to 'odb-tests/evolution/add-column/testscript')
-rw-r--r-- | odb-tests/evolution/add-column/testscript | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/odb-tests/evolution/add-column/testscript b/odb-tests/evolution/add-column/testscript new file mode 100644 index 0000000..a3f4a24 --- /dev/null +++ b/odb-tests/evolution/add-column/testscript @@ -0,0 +1,56 @@ +# file : evolution/add-column/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../$db-schema.testscript + +test.arguments += $($(db)_options) + +: basics +: +if! $sqlite +{ + ss = # Schema modification base file names. + + # Drop everything. + # + for s: $schemas + ss =+ $s + + # Add base schema. + # + ss += test3-002-pre test3-002-post + + # Add migration. + # + ss += test3-003-pre test3-003-post + + # Run tests. + # + for s: $ss + { + f = $out_base/"$s".sql + + if $mysql + cat $f | $create_schema_cmd + elif $pgsql + $create_schema_cmd -f $f + elif $oracle + $create_schema_cmd "@$f" + elif $mssql + $create_schema_cmd -i $f + + if ($s == 'test3-002-post') + $* 1 + elif ($s == 'test3-003-pre') + $* 2 + elif ($s == 'test3-003-post') + $* 3 + } +} +else +{ + $* 1 &odb-test.db + $* 2 + $* 3 +} |