~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/Makefile

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-23 11:57:21 UTC
  • mfrom: (7675.1045.1043 db-devel)
  • Revision ID: launchpad@pqm.canonical.com-20111223115721-c62r00egwv0qo5k4
Merging db-stable at revno 11226

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
59
59
 
64
64
# on production. It is generated using newbaseline.py in
65
65
# bzr+ssh://devpad.canonical.com/code/stub/dbascripts
66
66
#
67
 
REV=2208
 
67
REV=2209
68
68
BASELINE=launchpad-${REV}-00-0.sql
69
 
MD5SUM=12a258f8651ae3bba0c96ec8e62be1dd  launchpad-2208-00-0.sql
 
69
MD5SUM=cc7a493c924196409a22392a16443d52  launchpad-2209-00-0.sql
70
70
 
71
71
default: all
72
72
 
116
116
        @ echo
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; \
122
 
        fi
123
 
        @ if ! `createlang -l ${EMPTY_DBNAME} | grep -qs plpgsql`; then \
124
 
                echo "* Installing PL/PgSQL"; \
125
 
                createlang -d ${EMPTY_DBNAME} plpgsql; \
126
 
        fi
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"