Restructure file , remove html/admin , backup ...
This commit is contained in:
parent
b57df7c0e8
commit
896f3624c7
169 changed files with 48 additions and 54 deletions
23
include/sql/mod1/make-sql
Executable file
23
include/sql/mod1/make-sql
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
pg_dump -O -U phpcompta -s ${DOMAIN}mod1|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
|
||||
awk '/SEQUENCE/,/;/ { print $0;}' < schema.sql > sequence.sql
|
||||
awk '/CREATE DOMAIN/,/;/ { print $0;}' < schema.sql > table.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
|
||||
(
|
||||
echo " SET client_encoding = 'utf8';"
|
||||
echo " SET check_function_bodies = false;"
|
||||
echo " SET client_min_messages = warning;"
|
||||
echo "SET search_path = public, pg_catalog;"
|
||||
)> constraint.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
|
||||
|
||||
sed -i -e "/ALTER TABLE.*/d" -e "/ADD CONSTRAINT/d" -e "/CREATE PROCEDURAL/d" schema.sql
|
||||
|
||||
grep setval schema.sql >> sequence.sql
|
||||
pg_dump -O -U phpcompta -D -a -O ${DOMAIN}mod1 |sed "/^--/d" > data.sql
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue