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