activerecord-odbc-adapter 2.0
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 +139 -0
- data/LICENSE +5 -0
- data/NEWS +25 -0
- data/README +229 -0
- data/lib/active_record/connection_adapters/odbc_adapter.rb +1950 -0
- data/lib/active_record/vendor/odbcext_db2.rb +87 -0
- data/lib/active_record/vendor/odbcext_informix.rb +144 -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 +216 -0
- data/lib/active_record/vendor/odbcext_microsoftsqlserver_col.rb +40 -0
- data/lib/active_record/vendor/odbcext_mysql.rb +174 -0
- data/lib/active_record/vendor/odbcext_oracle.rb +219 -0
- data/lib/active_record/vendor/odbcext_postgresql.rb +158 -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_sqlanywhere.rb +115 -0
- data/lib/active_record/vendor/odbcext_sqlanywhere_col.rb +49 -0
- data/lib/active_record/vendor/odbcext_sybase.rb +213 -0
- data/lib/active_record/vendor/odbcext_sybase_col.rb +49 -0
- data/lib/active_record/vendor/odbcext_virtuoso.rb +158 -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 +367 -0
- data/support/pack_odbc.rb +119 -0
- data/support/rake/rails_plugin_package_task.rb +212 -0
- data/support/rake_fixes/README +6 -0
- data/support/rake_fixes/databases.dif +13 -0
- data/support/test/base_test.rb +1765 -0
- data/support/test/migration_test.rb +1007 -0
- data/test/connections/native_odbc/connection.rb +137 -0
- data/test/fixtures/db_definitions/db2.drop.sql +33 -0
- data/test/fixtures/db_definitions/db2.sql +237 -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 +33 -0
- data/test/fixtures/db_definitions/informix.sql +223 -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 +68 -0
- data/test/fixtures/db_definitions/ingres.sql +252 -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 +33 -0
- data/test/fixtures/db_definitions/mysql.sql +238 -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 +72 -0
- data/test/fixtures/db_definitions/oracle_odbc.sql +296 -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/postgresql.drop.sql +38 -0
- data/test/fixtures/db_definitions/postgresql.sql +267 -0
- data/test/fixtures/db_definitions/postgresql2.drop.sql +2 -0
- data/test/fixtures/db_definitions/postgresql2.sql +5 -0
- data/test/fixtures/db_definitions/progress.drop.sql +67 -0
- data/test/fixtures/db_definitions/progress.sql +255 -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 +35 -0
- data/test/fixtures/db_definitions/sqlserver.sql +247 -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 +35 -0
- data/test/fixtures/db_definitions/sybase.sql +222 -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 +33 -0
- data/test/fixtures/db_definitions/virtuoso.sql +218 -0
- data/test/fixtures/db_definitions/virtuoso2.drop.sql +2 -0
- data/test/fixtures/db_definitions/virtuoso2.sql +5 -0
- metadata +166 -0
@@ -0,0 +1,223 @@
|
|
1
|
+
--Ensure environment variable DELIMIDENT=y
|
2
|
+
|
3
|
+
create table accounts (
|
4
|
+
id serial primary key,
|
5
|
+
firm_id int,
|
6
|
+
credit_limit int
|
7
|
+
);
|
8
|
+
|
9
|
+
create table funny_jokes (
|
10
|
+
id serial primary key,
|
11
|
+
name varchar(50)
|
12
|
+
);
|
13
|
+
|
14
|
+
create table companies (
|
15
|
+
id serial primary key,
|
16
|
+
type varchar(50),
|
17
|
+
ruby_type varchar(50),
|
18
|
+
firm_id int,
|
19
|
+
name varchar(50),
|
20
|
+
client_of int,
|
21
|
+
rating int default 1
|
22
|
+
);
|
23
|
+
|
24
|
+
create table topics (
|
25
|
+
id serial primary key,
|
26
|
+
title varchar(255),
|
27
|
+
author_name varchar(255),
|
28
|
+
author_email_address varchar(255),
|
29
|
+
written_on datetime year to second,
|
30
|
+
bonus_time datetime year to second,
|
31
|
+
last_read date,
|
32
|
+
content varchar(255),
|
33
|
+
approved smallint default 1,
|
34
|
+
replies_count int default 0,
|
35
|
+
parent_id int,
|
36
|
+
type varchar(50)
|
37
|
+
);
|
38
|
+
|
39
|
+
create table developers (
|
40
|
+
id serial primary key,
|
41
|
+
name varchar(100),
|
42
|
+
salary int default 70000,
|
43
|
+
created_at datetime year to second,
|
44
|
+
updated_at datetime year to second
|
45
|
+
);
|
46
|
+
|
47
|
+
create table projects (
|
48
|
+
id serial primary key,
|
49
|
+
name varchar(100),
|
50
|
+
type varchar(255)
|
51
|
+
);
|
52
|
+
|
53
|
+
create table developers_projects (
|
54
|
+
developer_id int not null,
|
55
|
+
project_id int not null,
|
56
|
+
joined_on date,
|
57
|
+
access_level int default 1
|
58
|
+
);
|
59
|
+
|
60
|
+
create table orders (
|
61
|
+
id serial primary key,
|
62
|
+
name varchar(100),
|
63
|
+
billing_customer_id int,
|
64
|
+
shipping_customer_id int
|
65
|
+
);
|
66
|
+
|
67
|
+
|
68
|
+
create table customers (
|
69
|
+
id serial primary key,
|
70
|
+
name varchar(100),
|
71
|
+
balance int default 0,
|
72
|
+
address_street varchar(100),
|
73
|
+
address_city varchar(100),
|
74
|
+
address_country varchar(100),
|
75
|
+
gps_location varchar(100)
|
76
|
+
);
|
77
|
+
|
78
|
+
create table movies (
|
79
|
+
movieid serial primary key,
|
80
|
+
name varchar(100)
|
81
|
+
);
|
82
|
+
|
83
|
+
create table subscribers (
|
84
|
+
nick varchar(100) primary key,
|
85
|
+
name varchar(100)
|
86
|
+
);
|
87
|
+
|
88
|
+
create table booleantests (
|
89
|
+
id serial primary key,
|
90
|
+
value smallint
|
91
|
+
);
|
92
|
+
|
93
|
+
create table auto_id_tests (
|
94
|
+
auto_id serial primary key,
|
95
|
+
value int
|
96
|
+
);
|
97
|
+
|
98
|
+
create table entrants (
|
99
|
+
id int primary key,
|
100
|
+
name varchar(255) not null,
|
101
|
+
course_id int not null
|
102
|
+
);
|
103
|
+
|
104
|
+
create table colnametests (
|
105
|
+
id serial primary key,
|
106
|
+
"references" int not null
|
107
|
+
);
|
108
|
+
|
109
|
+
create table mixins (
|
110
|
+
id serial primary key,
|
111
|
+
parent_id int,
|
112
|
+
pos int,
|
113
|
+
created_at datetime year to second,
|
114
|
+
updated_at datetime year to second,
|
115
|
+
lft int,
|
116
|
+
rgt int,
|
117
|
+
root_id int,
|
118
|
+
type varchar(40)
|
119
|
+
);
|
120
|
+
|
121
|
+
create table people (
|
122
|
+
id serial,
|
123
|
+
first_name varchar(40),
|
124
|
+
lock_version int default 0,
|
125
|
+
primary key (id)
|
126
|
+
);
|
127
|
+
|
128
|
+
create table readers (
|
129
|
+
id serial,
|
130
|
+
post_id int not null,
|
131
|
+
person_id int not null,
|
132
|
+
primary key (id)
|
133
|
+
);
|
134
|
+
|
135
|
+
create table binaries (
|
136
|
+
id serial primary key,
|
137
|
+
data byte
|
138
|
+
);
|
139
|
+
|
140
|
+
create table computers (
|
141
|
+
id serial primary key,
|
142
|
+
developer int not null,
|
143
|
+
"extendedWarranty" int not null
|
144
|
+
);
|
145
|
+
|
146
|
+
create table posts (
|
147
|
+
id serial primary key,
|
148
|
+
author_id int,
|
149
|
+
title varchar(255),
|
150
|
+
type varchar(255),
|
151
|
+
body lvarchar
|
152
|
+
);
|
153
|
+
|
154
|
+
create table comments (
|
155
|
+
id serial primary key,
|
156
|
+
post_id int,
|
157
|
+
type varchar(255),
|
158
|
+
body lvarchar
|
159
|
+
);
|
160
|
+
|
161
|
+
create table authors (
|
162
|
+
id serial primary key,
|
163
|
+
name varchar(255)
|
164
|
+
);
|
165
|
+
|
166
|
+
create table tasks (
|
167
|
+
id serial primary key,
|
168
|
+
starting datetime year to second,
|
169
|
+
ending datetime year to second
|
170
|
+
);
|
171
|
+
|
172
|
+
create table categories (
|
173
|
+
id serial primary key,
|
174
|
+
name varchar(255),
|
175
|
+
type varchar(255)
|
176
|
+
);
|
177
|
+
|
178
|
+
create table categories_posts (
|
179
|
+
category_id int not null,
|
180
|
+
post_id int not null
|
181
|
+
);
|
182
|
+
|
183
|
+
create table fk_test_has_pk (
|
184
|
+
id integer primary key
|
185
|
+
);
|
186
|
+
|
187
|
+
create table fk_test_has_fk (
|
188
|
+
id integer primary key,
|
189
|
+
fk_id integer not null,
|
190
|
+
|
191
|
+
foreign key (fk_id) references fk_test_has_pk(id)
|
192
|
+
);
|
193
|
+
|
194
|
+
create table keyboards (
|
195
|
+
key_number serial primary key,
|
196
|
+
name varchar(50)
|
197
|
+
);
|
198
|
+
|
199
|
+
--This table has an altered lock_version column name.
|
200
|
+
create table legacy_things (
|
201
|
+
id serial,
|
202
|
+
tps_report_number int,
|
203
|
+
version int default 0,
|
204
|
+
primary key (id)
|
205
|
+
);
|
206
|
+
|
207
|
+
create table numeric_data (
|
208
|
+
id serial primary key,
|
209
|
+
bank_balance decimal(10,2),
|
210
|
+
big_bank_balance decimal(15,2),
|
211
|
+
world_population decimal(10,0),
|
212
|
+
my_house_population decimal(2,0),
|
213
|
+
decimal_number_with_default decimal(3,2) DEFAULT 2.78
|
214
|
+
);
|
215
|
+
|
216
|
+
create table mixed_case_monkeys (
|
217
|
+
"monkeyID" serial primary key,
|
218
|
+
"fleaCount" int
|
219
|
+
);
|
220
|
+
|
221
|
+
create table minimalistics (
|
222
|
+
id serial primary key
|
223
|
+
);
|
@@ -0,0 +1,68 @@
|
|
1
|
+
DROP TABLE accounts;
|
2
|
+
DROP TABLE funny_jokes;
|
3
|
+
DROP TABLE companies;
|
4
|
+
DROP TABLE topics;
|
5
|
+
DROP TABLE developers;
|
6
|
+
DROP TABLE projects;
|
7
|
+
DROP TABLE developers_projects;
|
8
|
+
DROP TABLE customers;
|
9
|
+
DROP TABLE orders;
|
10
|
+
DROP TABLE movies;
|
11
|
+
DROP TABLE subscribers;
|
12
|
+
DROP TABLE booleantests;
|
13
|
+
DROP TABLE auto_id_tests;
|
14
|
+
DROP TABLE entrants;
|
15
|
+
DROP TABLE colnametests;
|
16
|
+
DROP TABLE mixins;
|
17
|
+
DROP TABLE people;
|
18
|
+
DROP TABLE readers;
|
19
|
+
DROP TABLE binaries;
|
20
|
+
DROP TABLE computers;
|
21
|
+
DROP TABLE posts;
|
22
|
+
DROP TABLE comments;
|
23
|
+
DROP TABLE authors;
|
24
|
+
DROP TABLE tasks;
|
25
|
+
DROP TABLE categories;
|
26
|
+
DROP TABLE categories_posts;
|
27
|
+
DROP TABLE fk_test_has_fk;
|
28
|
+
DROP TABLE fk_test_has_pk;
|
29
|
+
DROP TABLE keyboards;
|
30
|
+
DROP TABLE legacy_things;
|
31
|
+
DROP TABLE numeric_data;
|
32
|
+
DROP TABLE mixed_case_monkeys;
|
33
|
+
DROP TABLE minimalistics;
|
34
|
+
|
35
|
+
drop sequence accounts_seq;
|
36
|
+
drop sequence funny_jokes_seq;
|
37
|
+
drop sequence companies_nonstd_seq;
|
38
|
+
drop sequence topics_seq;
|
39
|
+
drop sequence developers_seq;
|
40
|
+
drop sequence projects_seq;
|
41
|
+
drop sequence developers_projects_seq;
|
42
|
+
drop sequence customers_seq;
|
43
|
+
drop sequence orders_seq;
|
44
|
+
drop sequence movies_seq;
|
45
|
+
drop sequence subscribers_seq;
|
46
|
+
drop sequence booleantests_seq;
|
47
|
+
drop sequence auto_id_tests_seq;
|
48
|
+
drop sequence entrants_seq;
|
49
|
+
drop sequence colnametests_seq;
|
50
|
+
drop sequence mixins_seq;
|
51
|
+
drop sequence people_seq;
|
52
|
+
drop sequence readers_seq;
|
53
|
+
drop sequence binaries_seq;
|
54
|
+
drop sequence computers_seq;
|
55
|
+
drop sequence posts_seq;
|
56
|
+
drop sequence comments_seq;
|
57
|
+
drop sequence authors_seq;
|
58
|
+
drop sequence tasks_seq;
|
59
|
+
drop sequence categories_seq;
|
60
|
+
drop sequence categories_posts_seq;
|
61
|
+
drop sequence fk_test_has_pk_seq;
|
62
|
+
drop sequence fk_test_has_fk_seq;
|
63
|
+
drop sequence keyboards_seq;
|
64
|
+
drop sequence legacy_things_seq;
|
65
|
+
drop sequence numeric_data_seq;
|
66
|
+
drop sequence mixed_case_monkeys_seq;
|
67
|
+
drop sequence minimalistics_seq;
|
68
|
+
|
@@ -0,0 +1,252 @@
|
|
1
|
+
CREATE TABLE accounts (
|
2
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
3
|
+
firm_id INTEGER DEFAULT NULL,
|
4
|
+
credit_limit INTEGER DEFAULT NULL
|
5
|
+
) WITH PAGE_SIZE=8192;
|
6
|
+
CREATE SEQUENCE accounts_seq MINVALUE 10000;
|
7
|
+
|
8
|
+
CREATE TABLE funny_jokes (
|
9
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
10
|
+
name VARCHAR(50) DEFAULT NULL
|
11
|
+
) WITH PAGE_SIZE=8192;
|
12
|
+
CREATE SEQUENCE funny_jokes_seq MINVALUE 10000;
|
13
|
+
|
14
|
+
CREATE TABLE companies (
|
15
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
16
|
+
type VARCHAR(50) DEFAULT NULL,
|
17
|
+
ruby_type VARCHAR(50) DEFAULT NULL,
|
18
|
+
firm_id INTEGER DEFAULT NULL,
|
19
|
+
name VARCHAR(50) DEFAULT NULL,
|
20
|
+
client_of INTEGER DEFAULT NULL,
|
21
|
+
rating INTEGER DEFAULT 1
|
22
|
+
) WITH PAGE_SIZE=8192;
|
23
|
+
|
24
|
+
/* non-standard sequence name used to test set_sequence_name */
|
25
|
+
CREATE SEQUENCE companies_nonstd_seq MINVALUE 10000;
|
26
|
+
|
27
|
+
CREATE TABLE topics (
|
28
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
29
|
+
title VARCHAR(255) DEFAULT NULL,
|
30
|
+
author_name VARCHAR(255) DEFAULT NULL,
|
31
|
+
author_email_address VARCHAR(255) DEFAULT NULL,
|
32
|
+
written_on DATE DEFAULT NULL,
|
33
|
+
bonus_time DATE DEFAULT NULL,
|
34
|
+
last_read DATE DEFAULT NULL,
|
35
|
+
content VARCHAR(255),
|
36
|
+
approved TINYINT DEFAULT 1,
|
37
|
+
replies_count INTEGER DEFAULT 0,
|
38
|
+
parent_id INTEGER DEFAULT NULL,
|
39
|
+
type VARCHAR(50) DEFAULT NULL
|
40
|
+
) WITH PAGE_SIZE=8192;
|
41
|
+
CREATE SEQUENCE topics_seq MINVALUE 10000;
|
42
|
+
|
43
|
+
CREATE TABLE developers (
|
44
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
45
|
+
name VARCHAR(100) DEFAULT NULL,
|
46
|
+
salary INTEGER DEFAULT 70000,
|
47
|
+
created_at DATE DEFAULT NULL,
|
48
|
+
updated_at DATE DEFAULT NULL
|
49
|
+
) WITH PAGE_SIZE=8192;
|
50
|
+
CREATE SEQUENCE developers_seq MINVALUE 10000;
|
51
|
+
|
52
|
+
CREATE TABLE projects (
|
53
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
54
|
+
name VARCHAR(100) DEFAULT NULL,
|
55
|
+
type VARCHAR(255) DEFAULT NULL
|
56
|
+
) WITH PAGE_SIZE=8192;
|
57
|
+
CREATE SEQUENCE projects_seq MINVALUE 10000;
|
58
|
+
|
59
|
+
CREATE TABLE developers_projects (
|
60
|
+
developer_id INTEGER NOT NULL,
|
61
|
+
project_id INTEGER NOT NULL,
|
62
|
+
joined_on DATE DEFAULT NULL,
|
63
|
+
access_level SMALLINT DEFAULT 1
|
64
|
+
) WITH PAGE_SIZE=8192;
|
65
|
+
CREATE SEQUENCE developers_projects_seq MINVALUE 10000;
|
66
|
+
|
67
|
+
CREATE TABLE customers (
|
68
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
69
|
+
name VARCHAR(100) DEFAULT NULL,
|
70
|
+
balance INTEGER DEFAULT 0,
|
71
|
+
address_street VARCHAR(100) DEFAULT NULL,
|
72
|
+
address_city VARCHAR(100) DEFAULT NULL,
|
73
|
+
address_country VARCHAR(100) DEFAULT NULL,
|
74
|
+
gps_location VARCHAR(100) DEFAULT NULL
|
75
|
+
) WITH PAGE_SIZE=8192;
|
76
|
+
CREATE SEQUENCE customers_seq MINVALUE 10000;
|
77
|
+
|
78
|
+
CREATE TABLE orders (
|
79
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
80
|
+
name VARCHAR(100) DEFAULT NULL,
|
81
|
+
billing_customer_id INTEGER DEFAULT NULL,
|
82
|
+
shipping_customer_id INTEGER DEFAULT NULL
|
83
|
+
) WITH PAGE_SIZE=8192;
|
84
|
+
CREATE SEQUENCE orders_seq MINVALUE 10000;
|
85
|
+
|
86
|
+
CREATE TABLE movies (
|
87
|
+
movieid INTEGER PRIMARY KEY NOT NULL,
|
88
|
+
name VARCHAR(100) DEFAULT NULL
|
89
|
+
) WITH PAGE_SIZE=8192;
|
90
|
+
CREATE SEQUENCE movies_seq MINVALUE 10000;
|
91
|
+
|
92
|
+
CREATE TABLE subscribers (
|
93
|
+
nick VARCHAR(100) NOT NULL,
|
94
|
+
name VARCHAR(100) DEFAULT NULL
|
95
|
+
) WITH PAGE_SIZE=8192;
|
96
|
+
CREATE SEQUENCE subscribers_seq MINVALUE 10000;
|
97
|
+
|
98
|
+
CREATE TABLE booleantests (
|
99
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
100
|
+
value INTEGER DEFAULT NULL
|
101
|
+
) WITH PAGE_SIZE=8192;
|
102
|
+
CREATE SEQUENCE booleantests_seq MINVALUE 10000;
|
103
|
+
|
104
|
+
CREATE TABLE auto_id_tests (
|
105
|
+
auto_id INTEGER PRIMARY KEY NOT NULL,
|
106
|
+
value INTEGER DEFAULT NULL
|
107
|
+
) WITH PAGE_SIZE=8192;
|
108
|
+
CREATE SEQUENCE auto_id_tests_seq MINVALUE 10000;
|
109
|
+
|
110
|
+
CREATE TABLE entrants (
|
111
|
+
id INTEGER NOT NULL PRIMARY KEY,
|
112
|
+
name VARCHAR(255) NOT NULL,
|
113
|
+
course_id INTEGER NOT NULL
|
114
|
+
) WITH PAGE_SIZE=8192;
|
115
|
+
CREATE SEQUENCE entrants_seq MINVALUE 10000;
|
116
|
+
|
117
|
+
CREATE TABLE colnametests (
|
118
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
119
|
+
references INTEGER NOT NULL
|
120
|
+
) WITH PAGE_SIZE=8192;
|
121
|
+
CREATE SEQUENCE colnametests_seq MINVALUE 10000;
|
122
|
+
|
123
|
+
CREATE TABLE mixins (
|
124
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
125
|
+
parent_id INTEGER DEFAULT NULL,
|
126
|
+
pos INTEGER DEFAULT NULL,
|
127
|
+
created_at DATE DEFAULT NULL,
|
128
|
+
updated_at DATE DEFAULT NULL,
|
129
|
+
lft INTEGER DEFAULT NULL,
|
130
|
+
rgt INTEGER DEFAULT NULL,
|
131
|
+
root_id INTEGER DEFAULT NULL,
|
132
|
+
type VARCHAR(40) DEFAULT NULL
|
133
|
+
) WITH PAGE_SIZE=8192;
|
134
|
+
CREATE SEQUENCE mixins_seq MINVALUE 10000;
|
135
|
+
|
136
|
+
CREATE TABLE people (
|
137
|
+
id INTEGER NOT NULL PRIMARY KEY,
|
138
|
+
first_name VARCHAR(40),
|
139
|
+
lock_version INTEGER DEFAULT 0
|
140
|
+
) WITH PAGE_SIZE=8192;
|
141
|
+
CREATE SEQUENCE people_seq MINVALUE 10000;
|
142
|
+
|
143
|
+
CREATE TABLE readers (
|
144
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
145
|
+
post_id INTEGER NOT NULL,
|
146
|
+
person_id INTEGER NOT NULL
|
147
|
+
) WITH PAGE_SIZE=8192;
|
148
|
+
CREATE SEQUENCE readers_seq MINVALUE 10000;
|
149
|
+
|
150
|
+
CREATE TABLE binaries (
|
151
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
152
|
+
data LONG BYTE
|
153
|
+
) WITH PAGE_SIZE=8192;
|
154
|
+
CREATE SEQUENCE binaries_seq MINVALUE 10000;
|
155
|
+
|
156
|
+
CREATE TABLE computers (
|
157
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
158
|
+
developer INTEGER NOT NULL,
|
159
|
+
"extendedWarranty" INTEGER NOT NULL
|
160
|
+
) WITH PAGE_SIZE=8192;
|
161
|
+
CREATE SEQUENCE computers_seq MINVALUE 10000;
|
162
|
+
|
163
|
+
CREATE TABLE posts (
|
164
|
+
id INTEGER NOT NULL PRIMARY KEY,
|
165
|
+
author_id INTEGER,
|
166
|
+
title VARCHAR(255) DEFAULT NULL,
|
167
|
+
body BYTE VARYING DEFAULT NULL,
|
168
|
+
type VARCHAR(255) DEFAULT NULL
|
169
|
+
) WITH PAGE_SIZE=8192;
|
170
|
+
CREATE SEQUENCE posts_seq MINVALUE 10000;
|
171
|
+
|
172
|
+
CREATE TABLE comments (
|
173
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
174
|
+
post_id INTEGER DEFAULT NULL,
|
175
|
+
body LONG VARCHAR,
|
176
|
+
type VARCHAR(255) DEFAULT NULL
|
177
|
+
) WITH PAGE_SIZE=8192;
|
178
|
+
CREATE SEQUENCE comments_seq MINVALUE 10000;
|
179
|
+
|
180
|
+
CREATE TABLE authors (
|
181
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
182
|
+
name VARCHAR(255) DEFAULT NULL
|
183
|
+
) WITH PAGE_SIZE=8192;
|
184
|
+
CREATE SEQUENCE authors_seq MINVALUE 10000;
|
185
|
+
|
186
|
+
CREATE TABLE tasks (
|
187
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
188
|
+
starting DATE DEFAULT NULL,
|
189
|
+
ending DATE DEFAULT NULL
|
190
|
+
) WITH PAGE_SIZE=8192;
|
191
|
+
CREATE SEQUENCE tasks_seq MINVALUE 10000;
|
192
|
+
|
193
|
+
|
194
|
+
CREATE TABLE categories (
|
195
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
196
|
+
name VARCHAR(255) DEFAULT NULL,
|
197
|
+
type VARCHAR(255) DEFAULT NULL
|
198
|
+
) WITH PAGE_SIZE=8192;
|
199
|
+
CREATE SEQUENCE categories_seq MINVALUE 10000;
|
200
|
+
|
201
|
+
CREATE TABLE categories_posts (
|
202
|
+
category_id INTEGER NOT NULL,
|
203
|
+
post_id INTEGER NOT NULL
|
204
|
+
) WITH PAGE_SIZE=8192;
|
205
|
+
CREATE SEQUENCE categories_posts_seq MINVALUE 10000;
|
206
|
+
|
207
|
+
CREATE TABLE fk_test_has_pk (
|
208
|
+
id INTEGER PRIMARY KEY NOT NULL
|
209
|
+
) WITH PAGE_SIZE=8192;
|
210
|
+
CREATE SEQUENCE fk_test_has_pk_seq MINVALUE 10000;
|
211
|
+
|
212
|
+
CREATE TABLE fk_test_has_fk (
|
213
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
214
|
+
fk_id INTEGER NOT NULL,
|
215
|
+
|
216
|
+
FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
|
217
|
+
) WITH PAGE_SIZE=8192;
|
218
|
+
CREATE SEQUENCE fk_test_has_fk_seq MINVALUE 10000;
|
219
|
+
|
220
|
+
CREATE TABLE keyboards (
|
221
|
+
key_number INTEGER PRIMARY KEY NOT NULL,
|
222
|
+
name VARCHAR(50) DEFAULT NULL
|
223
|
+
) WITH PAGE_SIZE=8192;
|
224
|
+
CREATE SEQUENCE keyboards_seq MINVALUE 10000;
|
225
|
+
|
226
|
+
CREATE TABLE legacy_things (
|
227
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
228
|
+
tps_report_number INTEGER DEFAULT NULL,
|
229
|
+
version INTEGER DEFAULT 0
|
230
|
+
) WITH PAGE_SIZE=8192;
|
231
|
+
CREATE SEQUENCE legacy_things_seq MINVALUE 10000;
|
232
|
+
|
233
|
+
CREATE TABLE numeric_data (
|
234
|
+
id INTEGER PRIMARY KEY NOT NULL,
|
235
|
+
bank_balance decimal(10,2),
|
236
|
+
big_bank_balance decimal(15,2),
|
237
|
+
world_population decimal(10,0),
|
238
|
+
my_house_population decimal(2,0),
|
239
|
+
decimal_number_with_default decimal(3,2) DEFAULT 2.78
|
240
|
+
) WITH PAGE_SIZE=8192;
|
241
|
+
CREATE SEQUENCE numeric_data_seq MINVALUE 10000;
|
242
|
+
|
243
|
+
CREATE TABLE mixed_case_monkeys (
|
244
|
+
"monkeyID" INTEGER PRIMARY KEY NOT NULL,
|
245
|
+
"fleaCount" INTEGER DEFAULT NULL
|
246
|
+
) WITH PAGE_SIZE=8192;
|
247
|
+
CREATE SEQUENCE mixed_case_monkeys_seq MINVALUE 10000;
|
248
|
+
|
249
|
+
CREATE TABLE minimalistics (
|
250
|
+
id INTEGER PRIMARY KEY NOT NULL
|
251
|
+
) WITH PAGE_SIZE=8192;
|
252
|
+
CREATE SEQUENCE minimalistics_seq MINVALUE 10000;
|