53
53
echo -n "-- Created using " >> $(2) && \
54
54
pg_dump --version >> $(2) && \
55
55
pg_dump --schema=public --disable-triggers -a --column-inserts -O ${1} \
56
| grep -v "\( TOC \|INSERT INTO launchpaddatabaserevision \|sessiondata\|sessionpkgdata\|SELECT pg_catalog\.setval\|^--\| fticache \|'fticache'\|ALTER TABLE secret\|INSERT INTO secret\)" \
56
| grep -v "\( TOC \|INSERT INTO launchpaddatabase\|sessiondata\|sessionpkgdata\|SELECT pg_catalog\.setval\|^--\| fticache \|'fticache'\|ALTER TABLE secret\|INSERT INTO secret\)" \
57
57
| $(PYTHON) sort_sql.py >> $(2) && \
58
58
$(PYTHON) fti.py --force -d ${1} -q
64
64
# on production. It is generated using newbaseline.py in
65
65
# bzr+ssh://devpad.canonical.com/code/stub/dbascripts
68
68
BASELINE=launchpad-${REV}-00-0.sql
69
MD5SUM=12a258f8651ae3bba0c96ec8e62be1dd launchpad-2208-00-0.sql
69
MD5SUM=cc7a493c924196409a22392a16443d52 launchpad-2209-00-0.sql
117
117
@ echo "* Creating database \"$(EMPTY_DBNAME)\"."
118
118
@ ${CREATEDB} template0 ${EMPTY_DBNAME}
119
@ if ! `createlang -l ${EMPTY_DBNAME} | grep -qs plpythonu`; then \
120
echo "* Installing PL/PythonU"; \
121
createlang -d ${EMPTY_DBNAME} plpythonu; \
123
@ if ! `createlang -l ${EMPTY_DBNAME} | grep -qs plpgsql`; then \
124
echo "* Installing PL/PgSQL"; \
125
createlang -d ${EMPTY_DBNAME} plpgsql; \
127
@ echo "* Creating todrop schema"
128
@ psql -d ${EMPTY_DBNAME} -q -c "CREATE SCHEMA todrop;"
129
@ echo "* Creating functions"
130
@ psql -d ${EMPTY_DBNAME} -f trusted.sql | grep : | cat
131
@ echo "* Installing tsearch2 into ts2 schema"
132
@ ${PYTHON} fti.py -q --setup-only -d ${EMPTY_DBNAME}
133
119
@ echo "* Loading base database schema"
134
120
@ psql -d ${EMPTY_DBNAME} -f ${BASELINE} | grep : | cat
135
121
@ echo "* Patching the database schema"
136
122
@ ${PYTHON} upgrade.py -d ${EMPTY_DBNAME}
137
@ echo "* Setting up full text indexes"
138
@ ${PYTHON} fti.py -q -d ${EMPTY_DBNAME}
139
123
@ echo "* Security setup"
140
124
@ ${PYTHON} security.py -q -d ${EMPTY_DBNAME}
141
125
@ echo "* Disabling autovacuum"