Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / rt / etc / upgrade / 3.9.8 / schema.Pg
1 DROP TABLE IF EXISTS Classes;
2 CREATE TABLE Classes (
3 id SERIAL,
4 Name varchar(255) NOT NULL DEFAULT '',
5 Description varchar(255) NOT NULL DEFAULT '',
6 SortOrder integer NOT NULL DEFAULT 0,
7 Disabled smallint NOT NULL DEFAULT 0,
8 Creator integer NOT NULL DEFAULT 0,
9 Created TIMESTAMP NULL,
10 LastUpdatedBy integer NOT NULL DEFAULT 0,
11 LastUpdated TIMESTAMP NULL,
12 HotList smallint NOT NULL DEFAULT 0,
13 PRIMARY KEY (id)
14 );
15
16 DROP TABLE IF EXISTS Articles;
17 CREATE TABLE Articles (
18 id SERIAL,
19 Name varchar(255) NOT NULL DEFAULT '',
20 Summary varchar(255) NOT NULL DEFAULT '',
21 SortOrder integer NOT NULL DEFAULT 0,
22 Class integer NOT NULL DEFAULT 0,
23 Parent integer NOT NULL DEFAULT 0,
24 URI varchar(255),
25 Creator integer NOT NULL DEFAULT 0,
26 Created TIMESTAMP NULL,
27 LastUpdatedBy integer NOT NULL DEFAULT 0,
28 LastUpdated TIMESTAMP NULL,
29 PRIMARY KEY (id)
30 );
31
32
33 DROP TABLE IF EXISTS Topics;
34 CREATE TABLE Topics (
35 id SERIAL,
36 Parent integer NOT NULL DEFAULT 0,
37 Name varchar(255) NOT NULL DEFAULT '',
38 Description varchar(255) NOT NULL DEFAULT '',
39 ObjectType varchar(64) NOT NULL DEFAULT '',
40 ObjectId integer NOT NULL,
41 PRIMARY KEY (id)
42 );
43
44
45 DROP TABLE IF EXISTS ObjectTopics;
46 CREATE TABLE ObjectTopics (
47 id SERIAL,
48 Topic integer NOT NULL,
49 ObjectType varchar(64) NOT NULL DEFAULT '',
50 ObjectId integer NOT NULL,
51 PRIMARY KEY (id)
52 );
53
54
55 DROP TABLE IF EXISTS ObjectClasses;
56 CREATE TABLE ObjectClasses (
57 id SERIAL,
58 Class integer NOT NULL,
59 ObjectType varchar(255) NOT NULL DEFAULT '',
60 ObjectId integer NOT NULL,
61 Creator integer NOT NULL DEFAULT 0,
62 Created TIMESTAMP NULL,
63 LastUpdatedBy integer NOT NULL DEFAULT 0,
64 LastUpdated TIMESTAMP NULL,
65 PRIMARY KEY (id)
66 );
67