altocompta/html/admin/sql/mod1/make-sql
2006-07-04 20:46:20 +00:00

12 lines
573 B
Text
Executable file

pg_dump -U phpcompta -s mod1 > 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 mod1 > data.sql