first pass RT4 merge, RT#13852
[freeside.git] / rt / etc / upgrade / 3.9.8 / schema.SQLite
1 CREATE TABLE Classes (
2 id INTEGER PRIMARY KEY,
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 );
13
14 CREATE TABLE Articles (
15 id INTEGER PRIMARY KEY,
16 Name varchar(255) NOT NULL DEFAULT '',
17 Summary varchar(255) NOT NULL DEFAULT '',
18 SortOrder integer NOT NULL DEFAULT 0,
19 Class integer NOT NULL DEFAULT 0,
20 Parent integer NOT NULL DEFAULT 0,
21 URI varchar(255),
22 Creator integer NOT NULL DEFAULT 0,
23 Created TIMESTAMP NULL,
24 LastUpdatedBy integer NOT NULL DEFAULT 0,
25 LastUpdated TIMESTAMP NULL
26 );
27
28
29 CREATE TABLE Topics (
30 id INTEGER PRIMARY KEY,
31 Parent integer NOT NULL DEFAULT 0,
32 Name varchar(255) NOT NULL DEFAULT '',
33 Description varchar(255) NOT NULL DEFAULT '',
34 ObjectType varchar(64) NOT NULL DEFAULT '',
35 ObjectId integer NOT NULL
36 );
37
38
39 CREATE TABLE ObjectTopics (
40 id INTEGER PRIMARY KEY,
41 Topic integer NOT NULL,
42 ObjectType varchar(64) NOT NULL DEFAULT '',
43 ObjectId integer NOT NULL
44 );
45
46 CREATE TABLE ObjectClasses (
47 id INTEGER PRIMARY KEY,
48 Class integer NOT NULL,
49 ObjectType varchar(64) NOT NULL DEFAULT '',
50 ObjectId integer NOT NULL,
51 Creator integer NOT NULL DEFAULT 0,
52 Created TIMESTAMP NULL,
53 LastUpdatedBy integer NOT NULL DEFAULT 0,
54 LastUpdated TIMESTAMP NULL
55 );