odbc-rails 1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +16 -0
- data/COPYING +21 -0
- data/ChangeLog +89 -0
- data/LICENSE +5 -0
- data/NEWS +12 -0
- data/README +282 -0
- data/lib/active_record/connection_adapters/odbc_adapter.rb +1792 -0
- data/lib/active_record/vendor/odbcext_db2.rb +87 -0
- data/lib/active_record/vendor/odbcext_informix.rb +132 -0
- data/lib/active_record/vendor/odbcext_informix_col.rb +45 -0
- data/lib/active_record/vendor/odbcext_ingres.rb +156 -0
- data/lib/active_record/vendor/odbcext_microsoftsqlserver.rb +185 -0
- data/lib/active_record/vendor/odbcext_microsoftsqlserver_col.rb +40 -0
- data/lib/active_record/vendor/odbcext_mysql.rb +136 -0
- data/lib/active_record/vendor/odbcext_oracle.rb +220 -0
- data/lib/active_record/vendor/odbcext_postgresql.rb +179 -0
- data/lib/active_record/vendor/odbcext_progress.rb +139 -0
- data/lib/active_record/vendor/odbcext_progress89.rb +259 -0
- data/lib/active_record/vendor/odbcext_sybase.rb +212 -0
- data/lib/active_record/vendor/odbcext_sybase_col.rb +49 -0
- data/lib/active_record/vendor/odbcext_virtuoso.rb +146 -0
- data/lib/odbc_adapter.rb +28 -0
- data/support/lib/active_record/connection_adapters/abstract/schema_definitions.rb +259 -0
- data/support/odbc_rails.diff +707 -0
- data/support/pack_odbc.rb +119 -0
- data/support/rake/rails_plugin_package_task.rb +212 -0
- data/support/test/base_test.rb +1349 -0
- data/support/test/migration_test.rb +566 -0
- data/test/connections/native_odbc/connection.rb +95 -0
- data/test/fixtures/db_definitions/db2.drop.sql +30 -0
- data/test/fixtures/db_definitions/db2.sql +217 -0
- data/test/fixtures/db_definitions/db22.drop.sql +2 -0
- data/test/fixtures/db_definitions/db22.sql +5 -0
- data/test/fixtures/db_definitions/informix.drop.sql +30 -0
- data/test/fixtures/db_definitions/informix.sql +205 -0
- data/test/fixtures/db_definitions/informix2.drop.sql +2 -0
- data/test/fixtures/db_definitions/informix2.sql +5 -0
- data/test/fixtures/db_definitions/ingres.drop.sql +62 -0
- data/test/fixtures/db_definitions/ingres.sql +232 -0
- data/test/fixtures/db_definitions/ingres2.drop.sql +2 -0
- data/test/fixtures/db_definitions/ingres2.sql +5 -0
- data/test/fixtures/db_definitions/mysql.drop.sql +30 -0
- data/test/fixtures/db_definitions/mysql.sql +219 -0
- data/test/fixtures/db_definitions/mysql2.drop.sql +2 -0
- data/test/fixtures/db_definitions/mysql2.sql +5 -0
- data/test/fixtures/db_definitions/oracle_odbc.drop.sql +64 -0
- data/test/fixtures/db_definitions/oracle_odbc.sql +257 -0
- data/test/fixtures/db_definitions/oracle_odbc2.drop.sql +2 -0
- data/test/fixtures/db_definitions/oracle_odbc2.sql +6 -0
- data/test/fixtures/db_definitions/progress.drop.sql +61 -0
- data/test/fixtures/db_definitions/progress.sql +234 -0
- data/test/fixtures/db_definitions/progress2.drop.sql +2 -0
- data/test/fixtures/db_definitions/progress2.sql +6 -0
- data/test/fixtures/db_definitions/sqlserver.drop.sql +30 -0
- data/test/fixtures/db_definitions/sqlserver.sql +203 -0
- data/test/fixtures/db_definitions/sqlserver2.drop.sql +2 -0
- data/test/fixtures/db_definitions/sqlserver2.sql +5 -0
- data/test/fixtures/db_definitions/sybase.drop.sql +31 -0
- data/test/fixtures/db_definitions/sybase.sql +204 -0
- data/test/fixtures/db_definitions/sybase2.drop.sql +4 -0
- data/test/fixtures/db_definitions/sybase2.sql +5 -0
- data/test/fixtures/db_definitions/virtuoso.drop.sql +30 -0
- data/test/fixtures/db_definitions/virtuoso.sql +200 -0
- data/test/fixtures/db_definitions/virtuoso2.drop.sql +2 -0
- data/test/fixtures/db_definitions/virtuoso2.sql +5 -0
- metadata +149 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
drop table accounts;
|
2
|
+
drop table funny_jokes;
|
3
|
+
drop table companies;
|
4
|
+
drop table topics;
|
5
|
+
drop synonym subjects;
|
6
|
+
drop table developers_projects;
|
7
|
+
drop table computers;
|
8
|
+
drop table developers;
|
9
|
+
drop table projects;
|
10
|
+
drop table customers;
|
11
|
+
drop table orders;
|
12
|
+
drop table movies;
|
13
|
+
drop table subscribers;
|
14
|
+
drop table booleantests;
|
15
|
+
drop table auto_id_tests;
|
16
|
+
drop table entrants;
|
17
|
+
drop table colnametests;
|
18
|
+
drop table mixins;
|
19
|
+
drop table people;
|
20
|
+
drop table readers;
|
21
|
+
drop table binaries;
|
22
|
+
drop table comments;
|
23
|
+
drop table authors;
|
24
|
+
drop table tasks;
|
25
|
+
drop table categories_posts;
|
26
|
+
drop table categories;
|
27
|
+
drop table posts;
|
28
|
+
drop table fk_test_has_pk;
|
29
|
+
drop table fk_test_has_fk;
|
30
|
+
drop table keyboards;
|
31
|
+
drop table legacy_things;
|
32
|
+
drop table test_oracle_defaults;
|
33
|
+
|
34
|
+
drop sequence accounts_seq;
|
35
|
+
drop sequence funny_jokes_seq;
|
36
|
+
drop sequence companies_nonstd_seq;
|
37
|
+
drop sequence topics_seq;
|
38
|
+
drop sequence developers_seq;
|
39
|
+
drop sequence projects_seq;
|
40
|
+
drop sequence developers_projects_seq;
|
41
|
+
drop sequence customers_seq;
|
42
|
+
drop sequence orders_seq;
|
43
|
+
drop sequence movies_seq;
|
44
|
+
drop sequence subscribers_seq;
|
45
|
+
drop sequence booleantests_seq;
|
46
|
+
drop sequence auto_id_tests_seq;
|
47
|
+
drop sequence entrants_seq;
|
48
|
+
drop sequence colnametests_seq;
|
49
|
+
drop sequence mixins_seq;
|
50
|
+
drop sequence people_seq;
|
51
|
+
drop sequence readers_seq;
|
52
|
+
drop sequence binaries_seq;
|
53
|
+
drop sequence posts_seq;
|
54
|
+
drop sequence comments_seq;
|
55
|
+
drop sequence authors_seq;
|
56
|
+
drop sequence tasks_seq;
|
57
|
+
drop sequence computers_seq;
|
58
|
+
drop sequence categories_seq;
|
59
|
+
drop sequence categories_posts_seq;
|
60
|
+
drop sequence fk_test_has_pk_seq;
|
61
|
+
drop sequence fk_test_has_fk_seq;
|
62
|
+
drop sequence keyboards_seq;
|
63
|
+
drop sequence legacy_things_seq;
|
64
|
+
drop sequence test_oracle_defaults_seq;
|
@@ -0,0 +1,257 @@
|
|
1
|
+
create table companies (
|
2
|
+
id number(10) not null,
|
3
|
+
type varchar(50) default null,
|
4
|
+
ruby_type varchar(50) default null,
|
5
|
+
firm_id number(10) default null references companies initially deferred disable,
|
6
|
+
name varchar(50) default null,
|
7
|
+
client_of number(10) default null references companies initially deferred disable,
|
8
|
+
companies_count number(10) default 0,
|
9
|
+
rating number(10) default 1,
|
10
|
+
primary key (id)
|
11
|
+
);
|
12
|
+
|
13
|
+
-- non-standard sequence name used to test set_sequence_name
|
14
|
+
--
|
15
|
+
create sequence companies_nonstd_seq minvalue 10000;
|
16
|
+
|
17
|
+
create table funny_jokes (
|
18
|
+
id number(10) not null,
|
19
|
+
name varchar(50) default null,
|
20
|
+
primary key (id)
|
21
|
+
);
|
22
|
+
create sequence funny_jokes_seq minvalue 10000;
|
23
|
+
|
24
|
+
create table accounts (
|
25
|
+
id number(10) not null,
|
26
|
+
firm_id number(10) default null references companies initially deferred disable,
|
27
|
+
credit_limit number(10) default null
|
28
|
+
);
|
29
|
+
create sequence accounts_seq minvalue 10000;
|
30
|
+
|
31
|
+
create table topics (
|
32
|
+
id number(10) not null,
|
33
|
+
title varchar(255) default null,
|
34
|
+
author_name varchar(255) default null,
|
35
|
+
author_email_address varchar(255) default null,
|
36
|
+
written_on timestamp default null,
|
37
|
+
bonus_time timestamp default null,
|
38
|
+
last_read timestamp default null,
|
39
|
+
content varchar(4000),
|
40
|
+
approved number(10) default 1,
|
41
|
+
replies_count number(10) default 0,
|
42
|
+
parent_id number(10) references topics initially deferred disable,
|
43
|
+
type varchar(50) default null,
|
44
|
+
primary key (id)
|
45
|
+
);
|
46
|
+
create sequence topics_seq minvalue 10000;
|
47
|
+
|
48
|
+
create synonym subjects for topics;
|
49
|
+
|
50
|
+
create table developers (
|
51
|
+
id number(10) not null,
|
52
|
+
name varchar(100) default null,
|
53
|
+
salary number(10) default 70000,
|
54
|
+
created_at timestamp default null,
|
55
|
+
updated_at timestamp default null,
|
56
|
+
primary key (id)
|
57
|
+
);
|
58
|
+
create sequence developers_seq minvalue 10000;
|
59
|
+
|
60
|
+
create table projects (
|
61
|
+
id number(10) not null,
|
62
|
+
name varchar(100) default null,
|
63
|
+
type varchar(255) default null,
|
64
|
+
primary key (id)
|
65
|
+
);
|
66
|
+
create sequence projects_seq minvalue 10000;
|
67
|
+
|
68
|
+
create table developers_projects (
|
69
|
+
developer_id number(10) not null references developers initially deferred disable,
|
70
|
+
project_id number(10) not null references projects initially deferred disable,
|
71
|
+
joined_on timestamp default null,
|
72
|
+
access_level number(10) default 1
|
73
|
+
);
|
74
|
+
create sequence developers_projects_seq minvalue 10000;
|
75
|
+
|
76
|
+
create table orders (
|
77
|
+
id number(10) not null,
|
78
|
+
name varchar(100) default null,
|
79
|
+
billing_customer_id number(10) default null,
|
80
|
+
shipping_customer_id number(10) default null,
|
81
|
+
primary key (id)
|
82
|
+
);
|
83
|
+
create sequence orders_seq minvalue 10000;
|
84
|
+
|
85
|
+
create table customers (
|
86
|
+
id number(10) not null,
|
87
|
+
name varchar(100) default null,
|
88
|
+
balance number(10) default 0,
|
89
|
+
address_street varchar(100) default null,
|
90
|
+
address_city varchar(100) default null,
|
91
|
+
address_country varchar(100) default null,
|
92
|
+
gps_location varchar(100) default null,
|
93
|
+
primary key (id)
|
94
|
+
);
|
95
|
+
create sequence customers_seq minvalue 10000;
|
96
|
+
|
97
|
+
create table movies (
|
98
|
+
movieid number(10) not null,
|
99
|
+
name varchar(100) default null,
|
100
|
+
primary key (movieid)
|
101
|
+
);
|
102
|
+
create sequence movies_seq minvalue 10000;
|
103
|
+
|
104
|
+
create table subscribers (
|
105
|
+
nick varchar(100) not null,
|
106
|
+
name varchar(100) default null,
|
107
|
+
primary key (nick)
|
108
|
+
);
|
109
|
+
create sequence subscribers_seq minvalue 10000;
|
110
|
+
|
111
|
+
create table booleantests (
|
112
|
+
id number(10) not null,
|
113
|
+
value number(10) default null,
|
114
|
+
primary key (id)
|
115
|
+
);
|
116
|
+
create sequence booleantests_seq minvalue 10000;
|
117
|
+
|
118
|
+
create table auto_id_tests (
|
119
|
+
auto_id number(10) not null,
|
120
|
+
value number(10) default null,
|
121
|
+
primary key (auto_id)
|
122
|
+
);
|
123
|
+
create sequence auto_id_tests_seq minvalue 10000;
|
124
|
+
|
125
|
+
create table entrants (
|
126
|
+
id number(10) not null primary key,
|
127
|
+
name varchar(255) not null,
|
128
|
+
course_id number(10) not null
|
129
|
+
);
|
130
|
+
create sequence entrants_seq minvalue 10000;
|
131
|
+
|
132
|
+
create table colnametests (
|
133
|
+
id number(10) not null,
|
134
|
+
references number(10) not null,
|
135
|
+
primary key (id)
|
136
|
+
);
|
137
|
+
create sequence colnametests_seq minvalue 10000;
|
138
|
+
|
139
|
+
create table mixins (
|
140
|
+
id number(10) not null,
|
141
|
+
parent_id number(10) default null references mixins initially deferred disable,
|
142
|
+
type varchar(40) default null,
|
143
|
+
pos number(10) default null,
|
144
|
+
lft number(10) default null,
|
145
|
+
rgt number(10) default null,
|
146
|
+
root_id number(10) default null,
|
147
|
+
created_at timestamp default null,
|
148
|
+
updated_at timestamp default null,
|
149
|
+
primary key (id)
|
150
|
+
);
|
151
|
+
create sequence mixins_seq minvalue 10000;
|
152
|
+
|
153
|
+
create table people (
|
154
|
+
id number(10) not null,
|
155
|
+
first_name varchar(40) null,
|
156
|
+
lock_version number(10) default 0,
|
157
|
+
primary key (id)
|
158
|
+
);
|
159
|
+
create sequence people_seq minvalue 10000;
|
160
|
+
|
161
|
+
create table readers (
|
162
|
+
id number(10) not null,
|
163
|
+
post_id number(10) not null,
|
164
|
+
person_id number(10) not null,
|
165
|
+
primary key (id)
|
166
|
+
);
|
167
|
+
create sequence readers_seq minvalue 10000;
|
168
|
+
|
169
|
+
create table binaries (
|
170
|
+
id number(10) not null,
|
171
|
+
data blob null,
|
172
|
+
primary key (id)
|
173
|
+
);
|
174
|
+
create sequence binaries_seq minvalue 10000;
|
175
|
+
|
176
|
+
create table computers (
|
177
|
+
id number(10) not null primary key,
|
178
|
+
developer number(10) not null references developers initially deferred disable,
|
179
|
+
"extendedWarranty" number(10) not null
|
180
|
+
);
|
181
|
+
create sequence computers_seq minvalue 10000;
|
182
|
+
|
183
|
+
create table posts (
|
184
|
+
id number(10) not null primary key,
|
185
|
+
author_id number(10) default null,
|
186
|
+
title varchar(255) default null,
|
187
|
+
type varchar(255) default null,
|
188
|
+
body varchar(3000) default null
|
189
|
+
);
|
190
|
+
create sequence posts_seq minvalue 10000;
|
191
|
+
|
192
|
+
create table comments (
|
193
|
+
id number(10) not null primary key,
|
194
|
+
post_id number(10) default null,
|
195
|
+
type varchar(255) default null,
|
196
|
+
body varchar(3000) default null
|
197
|
+
);
|
198
|
+
create sequence comments_seq minvalue 10000;
|
199
|
+
|
200
|
+
create table authors (
|
201
|
+
id number(10) not null primary key,
|
202
|
+
name varchar(255) default null
|
203
|
+
);
|
204
|
+
create sequence authors_seq minvalue 10000;
|
205
|
+
|
206
|
+
create table tasks (
|
207
|
+
id number(10) not null primary key,
|
208
|
+
starting date default null,
|
209
|
+
ending date default null
|
210
|
+
);
|
211
|
+
create sequence tasks_seq minvalue 10000;
|
212
|
+
|
213
|
+
create table categories (
|
214
|
+
id number(10) not null primary key,
|
215
|
+
name varchar(255) default null,
|
216
|
+
type varchar(255) default null
|
217
|
+
);
|
218
|
+
create sequence categories_seq minvalue 10000;
|
219
|
+
|
220
|
+
create table categories_posts (
|
221
|
+
category_id number(10) not null references categories initially deferred disable,
|
222
|
+
post_id number(10) not null references posts initially deferred disable
|
223
|
+
);
|
224
|
+
create sequence categories_posts_seq minvalue 10000;
|
225
|
+
|
226
|
+
create table fk_test_has_pk (
|
227
|
+
id number(10) not null primary key
|
228
|
+
);
|
229
|
+
create sequence fk_test_has_pk_seq minvalue 10000;
|
230
|
+
|
231
|
+
create table fk_test_has_fk (
|
232
|
+
id number(10) not null primary key,
|
233
|
+
fk_id number(10) not null references fk_test_has_fk initially deferred disable
|
234
|
+
);
|
235
|
+
create sequence fk_test_has_fk_seq minvalue 10000;
|
236
|
+
|
237
|
+
create table keyboards (
|
238
|
+
key_number number(10) not null,
|
239
|
+
name varchar(50) default null
|
240
|
+
);
|
241
|
+
create sequence keyboards_seq minvalue 10000;
|
242
|
+
|
243
|
+
create table test_oracle_defaults (
|
244
|
+
id number(10) not null primary key,
|
245
|
+
test_char char(1) default 'X' not null,
|
246
|
+
test_string varchar2(20) default 'hello' not null,
|
247
|
+
test_int number(10) default 3 not null
|
248
|
+
);
|
249
|
+
create sequence test_oracle_defaults_seq minvalue 10000;
|
250
|
+
|
251
|
+
--This table has an altered lock_version column name.
|
252
|
+
create table legacy_things (
|
253
|
+
id number(10) not null primary key,
|
254
|
+
tps_report_number number(10) default null,
|
255
|
+
version number(10) default 0
|
256
|
+
);
|
257
|
+
create sequence legacy_things_seq minvalue 10000;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
drop table accounts;
|
2
|
+
drop table authors;
|
3
|
+
drop table auto_id_tests;
|
4
|
+
drop table binaries;
|
5
|
+
drop table booleantests;
|
6
|
+
drop table categories;
|
7
|
+
drop table categories_posts;
|
8
|
+
drop table colnametests;
|
9
|
+
drop table comments;
|
10
|
+
drop table companies;
|
11
|
+
drop table computers;
|
12
|
+
drop table customers;
|
13
|
+
drop table developers;
|
14
|
+
drop table developers_projects;
|
15
|
+
drop table entrants;
|
16
|
+
drop table fk_test_has_fk;
|
17
|
+
drop table fk_test_has_pk;
|
18
|
+
drop table funny_jokes;
|
19
|
+
drop table keyboards;
|
20
|
+
drop table legacy_things;
|
21
|
+
drop table mixins;
|
22
|
+
drop table movies;
|
23
|
+
drop table orders;
|
24
|
+
drop table people;
|
25
|
+
drop table posts;
|
26
|
+
drop table projects;
|
27
|
+
drop table readers;
|
28
|
+
drop table subscribers;
|
29
|
+
drop table tasks;
|
30
|
+
drop table topics;
|
31
|
+
|
32
|
+
drop sequence accounts_seq;
|
33
|
+
drop sequence authors_seq;
|
34
|
+
drop sequence auto_id_tests_seq;
|
35
|
+
drop sequence binaries_seq;
|
36
|
+
drop sequence booleantests_seq;
|
37
|
+
drop sequence categories_seq;
|
38
|
+
drop sequence categories_posts_seq;
|
39
|
+
drop sequence colnametests_seq;
|
40
|
+
drop sequence comments_seq;
|
41
|
+
drop sequence companies_seq;
|
42
|
+
drop sequence computers_seq;
|
43
|
+
drop sequence customers_seq;
|
44
|
+
drop sequence developers_seq;
|
45
|
+
drop sequence developers_projects_seq;
|
46
|
+
drop sequence entrants_seq;
|
47
|
+
drop sequence fk_test_has_fk_seq;
|
48
|
+
drop sequence fk_test_has_pk_seq;
|
49
|
+
drop sequence funny_jokes_seq;
|
50
|
+
drop sequence keyboards_seq;
|
51
|
+
drop sequence legacy_things_seq;
|
52
|
+
drop sequence mixins_seq;
|
53
|
+
drop sequence movies_seq;
|
54
|
+
drop sequence orders_seq;
|
55
|
+
drop sequence people_seq;
|
56
|
+
drop sequence posts_seq;
|
57
|
+
drop sequence projects_seq;
|
58
|
+
drop sequence readers_seq;
|
59
|
+
drop sequence subscribers_seq;
|
60
|
+
drop sequence tasks_seq;
|
61
|
+
drop sequence topics_seq;
|
@@ -0,0 +1,234 @@
|
|
1
|
+
create table accounts (
|
2
|
+
id integer not null primary key,
|
3
|
+
firm_id integer,
|
4
|
+
credit_limit integer
|
5
|
+
);
|
6
|
+
create sequence accounts_seq minvalue 10000;
|
7
|
+
|
8
|
+
create table authors (
|
9
|
+
id integer not null primary key,
|
10
|
+
name varchar(255)
|
11
|
+
);
|
12
|
+
create sequence authors_seq minvalue 10000;
|
13
|
+
|
14
|
+
create table auto_id_tests (
|
15
|
+
auto_id integer not null primary key,
|
16
|
+
value integer
|
17
|
+
);
|
18
|
+
create sequence auto_id_tests_seq minvalue 10000;
|
19
|
+
|
20
|
+
/*
|
21
|
+
* lvarbinary type imposes many restrictions
|
22
|
+
*
|
23
|
+
* create table binaries (
|
24
|
+
* id integer not null primary key,
|
25
|
+
* data lvarbinary(1048576)
|
26
|
+
* );
|
27
|
+
* create sequence binaries_seq minvalue 10000;
|
28
|
+
*/
|
29
|
+
|
30
|
+
create table booleantests (
|
31
|
+
id integer not null primary key,
|
32
|
+
value integer
|
33
|
+
);
|
34
|
+
create sequence booleantests_seq minvalue 10000;
|
35
|
+
|
36
|
+
create table categories (
|
37
|
+
id integer not null primary key,
|
38
|
+
name varchar(255),
|
39
|
+
"type" varchar(255)
|
40
|
+
);
|
41
|
+
create sequence categories_seq minvalue 10000;
|
42
|
+
|
43
|
+
create table categories_posts (
|
44
|
+
category_id integer not null,
|
45
|
+
post_id integer not null
|
46
|
+
);
|
47
|
+
create sequence categories_posts_seq minvalue 10000;
|
48
|
+
|
49
|
+
create table colnametests (
|
50
|
+
id integer not null primary key,
|
51
|
+
"references" integer not null
|
52
|
+
);
|
53
|
+
create sequence colnametests_seq minvalue 10000;
|
54
|
+
|
55
|
+
create table comments (
|
56
|
+
id integer not null primary key,
|
57
|
+
post_id integer,
|
58
|
+
"type" varchar(255),
|
59
|
+
body varchar(3000)
|
60
|
+
);
|
61
|
+
create sequence comments_seq minvalue 10000;
|
62
|
+
|
63
|
+
create table companies (
|
64
|
+
id integer not null primary key,
|
65
|
+
"type" varchar(50),
|
66
|
+
ruby_type varchar(50),
|
67
|
+
firm_id integer,
|
68
|
+
name varchar(50),
|
69
|
+
client_of integer,
|
70
|
+
companies_count integer default 0,
|
71
|
+
rating integer default 1
|
72
|
+
);
|
73
|
+
create sequence companies_seq minvalue 10000;
|
74
|
+
|
75
|
+
create table computers (
|
76
|
+
id integer not null primary key,
|
77
|
+
developer integer not null,
|
78
|
+
"extendedWarranty" integer not null
|
79
|
+
);
|
80
|
+
create sequence computers_seq minvalue 10000;
|
81
|
+
|
82
|
+
create table customers (
|
83
|
+
id integer not null primary key,
|
84
|
+
name varchar(100),
|
85
|
+
balance integer default 0,
|
86
|
+
address_street varchar(100),
|
87
|
+
address_city varchar(100),
|
88
|
+
address_country varchar(100),
|
89
|
+
gps_location varchar(100)
|
90
|
+
);
|
91
|
+
create sequence customers_seq minvalue 10000;
|
92
|
+
|
93
|
+
create table developers (
|
94
|
+
id integer not null primary key,
|
95
|
+
name varchar(100),
|
96
|
+
salary integer default 70000,
|
97
|
+
created_at timestamp,
|
98
|
+
updated_at timestamp
|
99
|
+
);
|
100
|
+
create sequence developers_seq minvalue 10000;
|
101
|
+
|
102
|
+
create table developers_projects (
|
103
|
+
developer_id integer not null,
|
104
|
+
project_id integer not null,
|
105
|
+
joined_on timestamp,
|
106
|
+
access_level integer default 1
|
107
|
+
);
|
108
|
+
create sequence developers_projects_seq minvalue 10000;
|
109
|
+
|
110
|
+
create table entrants (
|
111
|
+
id integer not null primary key,
|
112
|
+
name varchar(255),
|
113
|
+
course_id integer
|
114
|
+
);
|
115
|
+
create sequence entrants_seq minvalue 10000;
|
116
|
+
|
117
|
+
create table fk_test_has_fk (
|
118
|
+
id integer not null primary key,
|
119
|
+
fk_id integer not null
|
120
|
+
);
|
121
|
+
create sequence fk_test_has_fk_seq minvalue 10000;
|
122
|
+
|
123
|
+
create table fk_test_has_pk (
|
124
|
+
id integer not null primary key
|
125
|
+
);
|
126
|
+
create sequence fk_test_has_pk_seq minvalue 10000;
|
127
|
+
|
128
|
+
create table funny_jokes (
|
129
|
+
id integer not null primary key,
|
130
|
+
name varchar(50)
|
131
|
+
);
|
132
|
+
create sequence funny_jokes_seq minvalue 10000;
|
133
|
+
|
134
|
+
create table keyboards (
|
135
|
+
key_number integer not null primary key,
|
136
|
+
name varchar(50)
|
137
|
+
);
|
138
|
+
create sequence keyboards_seq minvalue 10000;
|
139
|
+
|
140
|
+
/*
|
141
|
+
* This table has an altered lock_version column name.
|
142
|
+
*/
|
143
|
+
create table legacy_things (
|
144
|
+
id integer not null primary key,
|
145
|
+
tps_report_number integer,
|
146
|
+
version integer default 0
|
147
|
+
);
|
148
|
+
create sequence legacy_things_seq minvalue 10000;
|
149
|
+
|
150
|
+
create table mixins (
|
151
|
+
id integer not null primary key,
|
152
|
+
parent_id integer,
|
153
|
+
"type" varchar(40),
|
154
|
+
pos integer,
|
155
|
+
lft integer,
|
156
|
+
rgt integer,
|
157
|
+
root_id integer,
|
158
|
+
created_at timestamp,
|
159
|
+
updated_at timestamp
|
160
|
+
);
|
161
|
+
create sequence mixins_seq minvalue 10000;
|
162
|
+
|
163
|
+
create table movies (
|
164
|
+
movieid integer not null primary key,
|
165
|
+
name varchar(100)
|
166
|
+
);
|
167
|
+
create sequence movies_seq minvalue 10000;
|
168
|
+
|
169
|
+
create table orders (
|
170
|
+
id integer not null primary key,
|
171
|
+
name varchar(100),
|
172
|
+
billing_customer_id integer,
|
173
|
+
shipping_customer_id integer
|
174
|
+
);
|
175
|
+
create sequence orders_seq minvalue 10000;
|
176
|
+
|
177
|
+
create table people (
|
178
|
+
id integer not null primary key,
|
179
|
+
first_name varchar(40) null,
|
180
|
+
lock_version integer default 0
|
181
|
+
);
|
182
|
+
create sequence people_seq minvalue 10000;
|
183
|
+
|
184
|
+
create table posts (
|
185
|
+
id integer not null primary key,
|
186
|
+
author_id integer,
|
187
|
+
title varchar(255),
|
188
|
+
"type" varchar(255),
|
189
|
+
body varchar(3000)
|
190
|
+
);
|
191
|
+
create sequence posts_seq minvalue 10000;
|
192
|
+
|
193
|
+
create table projects (
|
194
|
+
id integer not null primary key,
|
195
|
+
name varchar(100),
|
196
|
+
"type" varchar(255)
|
197
|
+
);
|
198
|
+
create sequence projects_seq minvalue 10000;
|
199
|
+
|
200
|
+
create table readers (
|
201
|
+
id integer not null primary key,
|
202
|
+
post_id integer not null,
|
203
|
+
person_id integer not null
|
204
|
+
);
|
205
|
+
create sequence readers_seq minvalue 10000;
|
206
|
+
|
207
|
+
create table subscribers (
|
208
|
+
nick varchar(100) not null primary key,
|
209
|
+
name varchar(100)
|
210
|
+
);
|
211
|
+
create sequence subscribers_seq minvalue 10000;
|
212
|
+
|
213
|
+
create table tasks (
|
214
|
+
id integer not null primary key,
|
215
|
+
starting date,
|
216
|
+
ending date
|
217
|
+
);
|
218
|
+
create sequence tasks_seq minvalue 10000;
|
219
|
+
|
220
|
+
create table topics (
|
221
|
+
id integer not null primary key,
|
222
|
+
title varchar(255),
|
223
|
+
author_name varchar(255),
|
224
|
+
author_email_address varchar(255),
|
225
|
+
written_on timestamp,
|
226
|
+
bonus_time timestamp,
|
227
|
+
last_read date,
|
228
|
+
content varchar(4000),
|
229
|
+
approved integer default 1,
|
230
|
+
replies_count integer default 0,
|
231
|
+
parent_id integer,
|
232
|
+
"type" varchar(50)
|
233
|
+
);
|
234
|
+
create sequence topics_seq minvalue 10000;
|