Change database
This commit is contained in:
parent
ee2af9acf3
commit
be106d42bd
14 changed files with 3495 additions and 1778 deletions
12
html/admin/sql/mod2/make-sql
Executable file
12
html/admin/sql/mod2/make-sql
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
pg_dump -U phpcompta -s mod2 | awk '!/--/ {if ( ! /^$/) print $0;}' > schema.sql
|
||||
awk '/SEQUENCE/,/;/ { print $0;}' < schema.sql > sequence.sql
|
||||
awk '/CREATE TABLE/,/;/ { print $0;}' < schema.sql > table.sql
|
||||
awk '/CREATE VIEW/,/;/ { print $0;}' < schema.sql > view.sql
|
||||
awk '/INDEX/,/;/ { print $0;}' < schema.sql > index.sql
|
||||
awk '/ALTER TABLE/,/;/ { print $0;}' < schema.sql > constraint.sql
|
||||
awk '/CREATE FUNCTION/,/LANGUAGE/ { print $0;}' < schema.sql > function.sql
|
||||
awk '/COMMENT/,/;/ {print $0;}' < schema.sql > comment.sql
|
||||
|
||||
grep setval schema.sql >> sequence.sql
|
||||
pg_dump -U phpcompta -D -a -O mod2 > data.sql
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue