generated
This commit is contained in:
35
create.sql.tmpl
Normal file
35
create.sql.tmpl
Normal file
@ -0,0 +1,35 @@
|
||||
-- -----------------------------------------------------
|
||||
-- THIS IS GENERATED CODE, DO NOT EDIT MANUALLY!
|
||||
-- ALL CHANGES WILL BE LOST AFTER THE NEXT RUN
|
||||
-- OF generate.py
|
||||
-- -----------------------------------------------------
|
||||
|
||||
#for $table in $tables
|
||||
CREATE TABLE ${table.name}_t (
|
||||
id serial not null primary key
|
||||
#for $column in $table.columns
|
||||
,$column.name $column.sqltype #slurp
|
||||
#if (('notnull' in $column) and $column.notnull)
|
||||
not null #slurp
|
||||
#end if
|
||||
#if (('primarykey' in $column) and $column.primarykey)
|
||||
primary key #slurp
|
||||
#end if
|
||||
#if (('foreignkey' in $column) and $column.foreignkey)
|
||||
references ${column.name}_t (id) #slurp
|
||||
#end if
|
||||
#if ('default' in $column)
|
||||
default $column.default #slurp
|
||||
#end if
|
||||
|
||||
#end for
|
||||
#if ('tableConstraints' in $table)
|
||||
#for $tableConstraint in $table.tableConstraints
|
||||
,$tableConstraint
|
||||
#end for
|
||||
#end if
|
||||
);
|
||||
|
||||
#end for
|
||||
|
||||
|
Reference in New Issue
Block a user