File: psql-destroy.sql

package info (click to toggle)
phpwiki 1.3.12p3-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 16,956 kB
  • ctags: 21,608
  • sloc: php: 82,335; xml: 3,840; sh: 1,522; sql: 1,198; perl: 625; makefile: 562; awk: 28
file content (86 lines) | stat: -rw-r--r-- 2,230 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
-- $Id: psql-destroy.sql,v 1.10 2006/05/18 06:08:33 rurban Exp $

\set QUIET

--================================================================
-- Prefix for table names.
--
-- You should set this to the same value you specify for
-- DATABASE_PREFIX in config/config.ini

\set prefix 	''

--================================================================
--
-- Don't modify below this point unless you know what you are doing.
--
--================================================================

\set qprefix '\'' :prefix '\''
\echo Dropping all PhpWiki tables with:
\echo '       prefix = ' :qprefix
\echo

\set page_tbl		:prefix 'page'
\set page_id_seq 	:prefix 'page_id_seq'
\set version_tbl	:prefix 'version'
\set recent_tbl		:prefix 'recent'
\set nonempty_tbl	:prefix 'nonempty'
\set link_tbl		:prefix 'link'
\set session_tbl	:prefix 'session'
\set pref_tbl		:prefix 'pref'
\set user_tbl	        :prefix 'user'
\set member_tbl 	:prefix 'member'
\set rating_tbl		:prefix 'rating'
\set accesslog_tbl	:prefix 'accesslog'

\echo Dropping table :version_tbl
DROP TABLE :version_tbl CASCADE;

\echo Dropping table :recent_tbl
DROP TABLE :recent_tbl CASCADE;

\echo Dropping table :nonempty_tbl
DROP TABLE :nonempty_tbl CASCADE;

\echo Dropping experimental pagedata tables (not yet used)
DROP TABLE pagedata CASCADE;
DROP TABLE versiondata CASCADE;
DROP TABLE pageperm CASCADE;

\echo Dropping table :link_tbl
DROP TABLE :link_tbl;

\echo Dropping table :rating_tbl
DROP TABLE :rating_tbl;

\set existing_page :prefix 'existing_page'
\echo Dropping view :existing_page
DROP VIEW :existing_page;

\set curr_page     :prefix 'curr_page'
\echo Dropping view :curr_page
DROP VIEW :curr_page;

\echo Dropping table :page_tbl
DROP TABLE :page_tbl CASCADE;
\echo Dropping :page_id_seq only needed for postgresql < 7.2

\echo Dropping table :member_tbl
DROP TABLE :member_tbl;

\echo Dropping table :pref_tbl
DROP TABLE :pref_tbl;

--\echo Dropping table :user_tbl
DROP TABLE :user_tbl;

\echo Dropping table :session_tbl
DROP TABLE :session_tbl;

\echo Dropping table :accesslog_tbl
DROP TABLE :accesslog_tbl;

\echo Dropping stored procedures
DROP FUNCTION update_recent (INT4, INT4);
DROP FUNCTION prepare_rename_page (INT4, INT4);