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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
CREATE TABLE accounts (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
firm_id INT DEFAULT NULL,
credit_limit INT DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE funny_jokes (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(50) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE companies (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
type VARCHAR(50) DEFAULT NULL,
ruby_type VARCHAR(50) DEFAULT NULL,
firm_id INT DEFAULT NULL,
name VARCHAR(50) DEFAULT NULL,
client_of INT DEFAULT NULL,
rating INT DEFAULT 1,
PRIMARY KEY (id)
);
CREATE TABLE topics (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
title VARCHAR(255) DEFAULT NULL,
author_name VARCHAR(255) DEFAULT NULL,
author_email_address VARCHAR(255) DEFAULT NULL,
written_on TIMESTAMP DEFAULT NULL,
bonus_time TIME DEFAULT NULL,
last_read DATE DEFAULT NULL,
content VARCHAR(3000),
approved SMALLINT DEFAULT 1,
replies_count INT DEFAULT 0,
parent_id INT DEFAULT NULL,
type VARCHAR(50) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE developers (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(100) DEFAULT NULL,
salary INT DEFAULT 70000,
created_at TIMESTAMP DEFAULT NULL,
updated_at TIMESTAMP DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE projects (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(100) DEFAULT NULL,
type VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE developers_projects (
developer_id INT NOT NULL,
project_id INT NOT NULL,
joined_on DATE DEFAULT NULL,
access_level SMALLINT DEFAULT 1
);
CREATE TABLE orders (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(100) DEFAULT NULL,
billing_customer_id INT DEFAULT NULL,
shipping_customer_id INT DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE customers (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(100) DEFAULT NULL,
balance INT DEFAULT 0,
address_street VARCHAR(100) DEFAULT NULL,
address_city VARCHAR(100) DEFAULT NULL,
address_country VARCHAR(100) DEFAULT NULL,
gps_location VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE movies (
movieid INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (movieid)
);
CREATE TABLE subscribers (
nick VARCHAR(100) NOT NULL,
name VARCHAR(100) DEFAULT NULL,
PRIMARY KEY (nick)
);
CREATE TABLE booleantests (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
value INT DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE auto_id_tests (
auto_id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
value INT DEFAULT NULL,
PRIMARY KEY (auto_id)
);
CREATE TABLE entrants (
id INT NOT NULL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
course_id INT NOT NULL
);
CREATE TABLE colnametests (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
references INT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE mixins (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
parent_id INT DEFAULT NULL,
pos INT DEFAULT NULL,
created_at TIMESTAMP DEFAULT NULL,
updated_at TIMESTAMP DEFAULT NULL,
lft INT DEFAULT NULL,
rgt INT DEFAULT NULL,
root_id INT DEFAULT NULL,
type VARCHAR(40) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE people (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
first_name VARCHAR(40) NOT NULL,
lock_version INT DEFAULT 0,
PRIMARY KEY (id)
);
CREATE TABLE readers (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
post_id INT NOT NULL,
person_id INT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE binaries (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
data BLOB(50000),
PRIMARY KEY (id)
);
CREATE TABLE computers (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
developer INT NOT NULL,
extendedWarranty INT NOT NULL
);
CREATE TABLE posts (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
author_id INT DEFAULT NULL,
title VARCHAR(255) DEFAULT NULL,
type VARCHAR(255) DEFAULT NULL,
body VARCHAR(3000) DEFAULT NULL
);
CREATE TABLE comments (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
post_id INT DEFAULT NULL,
type VARCHAR(255) DEFAULT NULL,
body VARCHAR(3000) DEFAULT NULL
);
CREATE TABLE authors (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(255) DEFAULT NULL
);
CREATE TABLE tasks (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
starting TIMESTAMP DEFAULT NULL,
ending TIMESTAMP DEFAULT NULL
);
CREATE TABLE categories (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(255) NOT NULL,
type VARCHAR(40) DEFAULT NULL
);
CREATE TABLE categories_posts (
category_id INT NOT NULL,
post_id INT NOT NULL
);
CREATE TABLE keyboards (
key_number INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
name VARCHAR(255)
);
CREATE TABLE fk_test_has_pk (
id INT NOT NULL PRIMARY KEY
);
CREATE TABLE fk_test_has_fk (
id INT NOT NULL PRIMARY KEY,
fk_id INT NOT NULL,
FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
);
--This table has an altered lock_version column name
CREATE TABLE legacy_things (
id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 10000),
tps_report_number INT DEFAULT NULL,
version INT DEFAULT 0,
PRIMARY KEY (id)
);
|