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,35 @@
|
|
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 defaults;
|
14
|
+
DROP TABLE auto_id_tests;
|
15
|
+
DROP TABLE entrants;
|
16
|
+
DROP TABLE colnametests;
|
17
|
+
DROP TABLE mixins;
|
18
|
+
DROP TABLE people;
|
19
|
+
DROP TABLE readers;
|
20
|
+
DROP TABLE binaries;
|
21
|
+
DROP TABLE computers;
|
22
|
+
DROP TABLE posts;
|
23
|
+
DROP TABLE comments;
|
24
|
+
DROP TABLE authors;
|
25
|
+
DROP TABLE tasks;
|
26
|
+
DROP TABLE categories;
|
27
|
+
DROP TABLE categories_posts;
|
28
|
+
DROP TABLE fk_test_has_fk;
|
29
|
+
DROP TABLE fk_test_has_pk;
|
30
|
+
DROP TABLE keyboards;
|
31
|
+
DROP TABLE legacy_things;
|
32
|
+
DROP TABLE numeric_data;
|
33
|
+
DROP TABLE mixed_case_monkeys;
|
34
|
+
DROP TABLE minimalistics;
|
35
|
+
DROP TABLE [order];
|
@@ -0,0 +1,247 @@
|
|
1
|
+
CREATE TABLE accounts (
|
2
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
3
|
+
firm_id int default NULL,
|
4
|
+
credit_limit int default NULL
|
5
|
+
);
|
6
|
+
|
7
|
+
CREATE TABLE funny_jokes (
|
8
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
9
|
+
name varchar(50) default NULL
|
10
|
+
);
|
11
|
+
|
12
|
+
CREATE TABLE companies (
|
13
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
14
|
+
type varchar(50) default NULL,
|
15
|
+
ruby_type varchar(50) default NULL,
|
16
|
+
firm_id int default NULL,
|
17
|
+
name varchar(50) default NULL,
|
18
|
+
client_of int default NULL,
|
19
|
+
rating int default 1
|
20
|
+
);
|
21
|
+
|
22
|
+
CREATE TABLE topics (
|
23
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
24
|
+
title varchar(255) default NULL,
|
25
|
+
author_name varchar(255) default NULL,
|
26
|
+
author_email_address varchar(255) default NULL,
|
27
|
+
written_on datetime default NULL,
|
28
|
+
bonus_time datetime default NULL,
|
29
|
+
last_read datetime default NULL,
|
30
|
+
content varchar(255) default NULL,
|
31
|
+
approved bit default 1,
|
32
|
+
replies_count int default 0,
|
33
|
+
parent_id int default NULL,
|
34
|
+
type varchar(50) default NULL
|
35
|
+
);
|
36
|
+
|
37
|
+
CREATE TABLE developers (
|
38
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
39
|
+
name varchar(100) default NULL,
|
40
|
+
salary int default 70000,
|
41
|
+
created_at datetime default NULL,
|
42
|
+
updated_at datetime default NULL
|
43
|
+
);
|
44
|
+
|
45
|
+
CREATE TABLE projects (
|
46
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
47
|
+
name varchar(100) default NULL,
|
48
|
+
type varchar(255) default NULL
|
49
|
+
);
|
50
|
+
|
51
|
+
CREATE TABLE developers_projects (
|
52
|
+
developer_id int NOT NULL,
|
53
|
+
project_id int NOT NULL,
|
54
|
+
joined_on datetime default NULL,
|
55
|
+
access_level int default 1
|
56
|
+
);
|
57
|
+
|
58
|
+
CREATE TABLE orders (
|
59
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
60
|
+
name varchar(100) default NULL,
|
61
|
+
billing_customer_id int default NULL,
|
62
|
+
shipping_customer_id int default NULL
|
63
|
+
);
|
64
|
+
|
65
|
+
|
66
|
+
CREATE TABLE customers (
|
67
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
68
|
+
name varchar(100) default NULL,
|
69
|
+
balance int default 0,
|
70
|
+
address_street varchar(100) default NULL,
|
71
|
+
address_city varchar(100) default NULL,
|
72
|
+
address_country varchar(100) default NULL,
|
73
|
+
gps_location varchar(100) default NULL
|
74
|
+
);
|
75
|
+
|
76
|
+
CREATE TABLE movies (
|
77
|
+
movieid int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
78
|
+
name varchar(100) default NULL
|
79
|
+
);
|
80
|
+
|
81
|
+
CREATE TABLE subscribers (
|
82
|
+
nick varchar(100) NOT NULL PRIMARY KEY,
|
83
|
+
name varchar(100) default NULL
|
84
|
+
);
|
85
|
+
|
86
|
+
CREATE TABLE booleantests (
|
87
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
88
|
+
value bit default NULL
|
89
|
+
);
|
90
|
+
|
91
|
+
CREATE TABLE defaults (
|
92
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
93
|
+
-- these brought from the PostgreSQL defaults_test.rb but
|
94
|
+
-- tests only exist for integers and decimals, currently
|
95
|
+
-- modified_date date default CURRENT_DATE,
|
96
|
+
-- modified_date_function date default now(),
|
97
|
+
-- fixed_date date default '2004-01-01',
|
98
|
+
-- modified_time timestamp default CURRENT_TIMESTAMP,
|
99
|
+
-- modified_time_function timestamp default now(),
|
100
|
+
-- fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
|
101
|
+
-- char1 char(1) default 'Y',
|
102
|
+
-- char2 character varying(50) default 'a varchar field',
|
103
|
+
-- char3 text default 'a text field',
|
104
|
+
positive_integer integer default 1,
|
105
|
+
negative_integer integer default -1,
|
106
|
+
decimal_number decimal(3,2) default 2.78
|
107
|
+
);
|
108
|
+
|
109
|
+
CREATE TABLE auto_id_tests (
|
110
|
+
auto_id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
111
|
+
value int default NULL
|
112
|
+
);
|
113
|
+
|
114
|
+
CREATE TABLE entrants (
|
115
|
+
id int NOT NULL PRIMARY KEY,
|
116
|
+
name varchar(255) NOT NULL,
|
117
|
+
course_id int NOT NULL
|
118
|
+
);
|
119
|
+
|
120
|
+
CREATE TABLE colnametests (
|
121
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
122
|
+
[references] int NOT NULL
|
123
|
+
);
|
124
|
+
|
125
|
+
CREATE TABLE mixins (
|
126
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
127
|
+
parent_id int default NULL,
|
128
|
+
pos int default NULL,
|
129
|
+
created_at datetime default NULL,
|
130
|
+
updated_at datetime default NULL,
|
131
|
+
lft int default NULL,
|
132
|
+
rgt int default NULL,
|
133
|
+
root_id int default NULL,
|
134
|
+
type varchar(40) default NULL
|
135
|
+
);
|
136
|
+
|
137
|
+
CREATE TABLE people (
|
138
|
+
id int NOT NULL IDENTITY(1, 1),
|
139
|
+
first_name varchar(40) NULL,
|
140
|
+
lock_version int default 0,
|
141
|
+
PRIMARY KEY (id)
|
142
|
+
);
|
143
|
+
|
144
|
+
CREATE TABLE readers (
|
145
|
+
id int NOT NULL IDENTITY(1, 1),
|
146
|
+
post_id int NOT NULL,
|
147
|
+
person_id int NOT NULL,
|
148
|
+
primary key (id)
|
149
|
+
);
|
150
|
+
|
151
|
+
CREATE TABLE binaries (
|
152
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
153
|
+
data image NULL
|
154
|
+
);
|
155
|
+
|
156
|
+
CREATE TABLE computers (
|
157
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
158
|
+
developer int NOT NULL,
|
159
|
+
extendedWarranty int NOT NULL
|
160
|
+
);
|
161
|
+
|
162
|
+
CREATE TABLE posts (
|
163
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
164
|
+
author_id int default NULL,
|
165
|
+
title varchar(255) default NULL,
|
166
|
+
type varchar(255) default NULL,
|
167
|
+
body varchar(4096) default NULL
|
168
|
+
);
|
169
|
+
|
170
|
+
CREATE TABLE comments (
|
171
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
172
|
+
post_id int default NULL,
|
173
|
+
type varchar(255) default NULL,
|
174
|
+
body varchar(4096) default NULL
|
175
|
+
);
|
176
|
+
|
177
|
+
CREATE TABLE authors (
|
178
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
179
|
+
name varchar(255) default NULL
|
180
|
+
);
|
181
|
+
|
182
|
+
CREATE TABLE tasks (
|
183
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
184
|
+
starting datetime default NULL,
|
185
|
+
ending datetime default NULL
|
186
|
+
);
|
187
|
+
|
188
|
+
CREATE TABLE categories (
|
189
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
190
|
+
name varchar(255),
|
191
|
+
type varchar(255) default NULL
|
192
|
+
);
|
193
|
+
|
194
|
+
CREATE TABLE categories_posts (
|
195
|
+
category_id int NOT NULL,
|
196
|
+
post_id int NOT NULL
|
197
|
+
);
|
198
|
+
|
199
|
+
CREATE TABLE fk_test_has_pk (
|
200
|
+
id INTEGER NOT NULL PRIMARY KEY
|
201
|
+
);
|
202
|
+
|
203
|
+
CREATE TABLE fk_test_has_fk (
|
204
|
+
id INTEGER NOT NULL PRIMARY KEY,
|
205
|
+
fk_id INTEGER NOT NULL,
|
206
|
+
|
207
|
+
FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
|
208
|
+
);
|
209
|
+
|
210
|
+
CREATE TABLE keyboards (
|
211
|
+
key_number int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
212
|
+
name varchar(50) default NULL
|
213
|
+
);
|
214
|
+
|
215
|
+
--This table has an altered lock_version column name.
|
216
|
+
CREATE TABLE legacy_things (
|
217
|
+
id int NOT NULL IDENTITY(1, 1),
|
218
|
+
tps_report_number int default NULL,
|
219
|
+
version int default 0,
|
220
|
+
PRIMARY KEY (id)
|
221
|
+
);
|
222
|
+
|
223
|
+
CREATE TABLE numeric_data (
|
224
|
+
id int NOT NULL IDENTITY(1, 1),
|
225
|
+
bank_balance decimal(10,2),
|
226
|
+
big_bank_balance decimal(15,2),
|
227
|
+
world_population decimal(10),
|
228
|
+
my_house_population decimal(2),
|
229
|
+
decimal_number_with_default decimal(3,2) DEFAULT 2.78
|
230
|
+
);
|
231
|
+
|
232
|
+
CREATE TABLE mixed_case_monkeys (
|
233
|
+
monkeyID int NOT NULL IDENTITY(1, 1),
|
234
|
+
fleaCount int default NULL
|
235
|
+
);
|
236
|
+
|
237
|
+
CREATE TABLE minimalistics (
|
238
|
+
id int NOT NULL IDENTITY(1, 1)
|
239
|
+
);
|
240
|
+
|
241
|
+
CREATE TABLE [order] (
|
242
|
+
id int NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
243
|
+
color varchar(255),
|
244
|
+
fruit_size varchar(255),
|
245
|
+
texture varchar(255),
|
246
|
+
flavor varchar(255)
|
247
|
+
);
|
@@ -0,0 +1,35 @@
|
|
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 tasks
|
22
|
+
DROP TABLE posts
|
23
|
+
DROP TABLE comments
|
24
|
+
DROP TABLE authors
|
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
|
+
DROP TABLE schema_info
|
35
|
+
go
|
@@ -0,0 +1,222 @@
|
|
1
|
+
CREATE TABLE accounts (
|
2
|
+
id int IDENTITY PRIMARY KEY,
|
3
|
+
firm_id int NULL,
|
4
|
+
credit_limit int NULL
|
5
|
+
)
|
6
|
+
|
7
|
+
CREATE TABLE funny_jokes (
|
8
|
+
id int IDENTITY PRIMARY KEY,
|
9
|
+
name varchar(50) NULL
|
10
|
+
)
|
11
|
+
|
12
|
+
CREATE TABLE companies (
|
13
|
+
id int IDENTITY PRIMARY KEY,
|
14
|
+
type varchar(50) NULL,
|
15
|
+
ruby_type varchar(50) NULL,
|
16
|
+
firm_id int NULL,
|
17
|
+
name varchar(50) NULL,
|
18
|
+
client_of int NULL,
|
19
|
+
rating int default 1
|
20
|
+
)
|
21
|
+
|
22
|
+
|
23
|
+
CREATE TABLE topics (
|
24
|
+
id int IDENTITY PRIMARY KEY,
|
25
|
+
title varchar(255) NULL,
|
26
|
+
author_name varchar(255) NULL,
|
27
|
+
author_email_address varchar(255) NULL,
|
28
|
+
written_on datetime NULL,
|
29
|
+
bonus_time datetime NULL,
|
30
|
+
last_read datetime NULL,
|
31
|
+
content varchar(255) NULL,
|
32
|
+
approved bit default 1,
|
33
|
+
replies_count int default 0,
|
34
|
+
parent_id int NULL,
|
35
|
+
type varchar(50) NULL
|
36
|
+
)
|
37
|
+
|
38
|
+
CREATE TABLE developers (
|
39
|
+
id int IDENTITY PRIMARY KEY,
|
40
|
+
name varchar(100) NULL,
|
41
|
+
salary int default 70000,
|
42
|
+
created_at datetime NULL,
|
43
|
+
updated_at datetime NULL
|
44
|
+
)
|
45
|
+
|
46
|
+
CREATE TABLE projects (
|
47
|
+
id int IDENTITY PRIMARY KEY,
|
48
|
+
name varchar(100) NULL,
|
49
|
+
type varchar(255) NULL
|
50
|
+
)
|
51
|
+
|
52
|
+
CREATE TABLE developers_projects (
|
53
|
+
developer_id int NOT NULL,
|
54
|
+
project_id int NOT NULL,
|
55
|
+
joined_on datetime NULL,
|
56
|
+
access_level smallint default 1
|
57
|
+
)
|
58
|
+
|
59
|
+
CREATE TABLE orders (
|
60
|
+
id int IDENTITY PRIMARY KEY,
|
61
|
+
name varchar(100) NULL,
|
62
|
+
billing_customer_id int NULL,
|
63
|
+
shipping_customer_id int NULL
|
64
|
+
)
|
65
|
+
|
66
|
+
CREATE TABLE customers (
|
67
|
+
id int IDENTITY PRIMARY KEY,
|
68
|
+
name varchar(100) NULL,
|
69
|
+
balance int default 0,
|
70
|
+
address_street varchar(100) NULL,
|
71
|
+
address_city varchar(100) NULL,
|
72
|
+
address_country varchar(100) NULL,
|
73
|
+
gps_location varchar(100) NULL
|
74
|
+
)
|
75
|
+
|
76
|
+
CREATE TABLE movies (
|
77
|
+
movieid int IDENTITY PRIMARY KEY,
|
78
|
+
name varchar(100) NULL
|
79
|
+
)
|
80
|
+
|
81
|
+
CREATE TABLE subscribers (
|
82
|
+
nick varchar(100) PRIMARY KEY,
|
83
|
+
name varchar(100) NULL
|
84
|
+
)
|
85
|
+
|
86
|
+
CREATE TABLE booleantests (
|
87
|
+
id int IDENTITY PRIMARY KEY,
|
88
|
+
value int NULL
|
89
|
+
)
|
90
|
+
|
91
|
+
CREATE TABLE auto_id_tests (
|
92
|
+
auto_id int IDENTITY PRIMARY KEY,
|
93
|
+
value int NULL
|
94
|
+
)
|
95
|
+
|
96
|
+
CREATE TABLE entrants (
|
97
|
+
id int IDENTITY PRIMARY KEY,
|
98
|
+
name varchar(255) NOT NULL,
|
99
|
+
course_id int NOT NULL
|
100
|
+
)
|
101
|
+
|
102
|
+
CREATE TABLE colnametests (
|
103
|
+
id int IDENTITY PRIMARY KEY,
|
104
|
+
[references] int NOT NULL
|
105
|
+
)
|
106
|
+
|
107
|
+
CREATE TABLE mixins (
|
108
|
+
id int IDENTITY PRIMARY KEY,
|
109
|
+
parent_id int NULL,
|
110
|
+
pos int NULL,
|
111
|
+
created_at datetime NULL,
|
112
|
+
updated_at datetime NULL,
|
113
|
+
lft int NULL,
|
114
|
+
rgt int NULL,
|
115
|
+
root_id int NULL,
|
116
|
+
type varchar(40) NULL
|
117
|
+
)
|
118
|
+
|
119
|
+
CREATE TABLE people (
|
120
|
+
id int IDENTITY PRIMARY KEY,
|
121
|
+
first_name varchar(40) NULL,
|
122
|
+
lock_version int DEFAULT 0
|
123
|
+
)
|
124
|
+
|
125
|
+
CREATE TABLE readers (
|
126
|
+
id int IDENTITY PRIMARY KEY,
|
127
|
+
post_id int NOT NULL,
|
128
|
+
person_id int NOT NULL
|
129
|
+
)
|
130
|
+
|
131
|
+
CREATE TABLE binaries (
|
132
|
+
id int IDENTITY PRIMARY KEY,
|
133
|
+
data image NULL
|
134
|
+
)
|
135
|
+
|
136
|
+
CREATE TABLE computers (
|
137
|
+
id int IDENTITY PRIMARY KEY,
|
138
|
+
developer int NOT NULL,
|
139
|
+
extendedWarranty int NOT NULL
|
140
|
+
)
|
141
|
+
|
142
|
+
CREATE TABLE posts (
|
143
|
+
id int IDENTITY PRIMARY KEY,
|
144
|
+
author_id int NULL,
|
145
|
+
title varchar(255) NOT NULL,
|
146
|
+
body varchar(2048) NOT NULL,
|
147
|
+
type varchar(255) NOT NULL
|
148
|
+
)
|
149
|
+
|
150
|
+
CREATE TABLE comments (
|
151
|
+
id int IDENTITY PRIMARY KEY,
|
152
|
+
post_id int NOT NULL,
|
153
|
+
body varchar(2048) NOT NULL,
|
154
|
+
type varchar(255) NOT NULL
|
155
|
+
)
|
156
|
+
|
157
|
+
CREATE TABLE authors (
|
158
|
+
id int IDENTITY PRIMARY KEY,
|
159
|
+
name varchar(255) NOT NULL
|
160
|
+
)
|
161
|
+
|
162
|
+
CREATE TABLE tasks (
|
163
|
+
id int IDENTITY PRIMARY KEY,
|
164
|
+
starting datetime NULL,
|
165
|
+
ending datetime NULL
|
166
|
+
)
|
167
|
+
|
168
|
+
CREATE TABLE categories (
|
169
|
+
id int IDENTITY PRIMARY KEY,
|
170
|
+
name varchar(255) NOT NULL,
|
171
|
+
type varchar(255) NOT NULL
|
172
|
+
)
|
173
|
+
|
174
|
+
CREATE TABLE categories_posts (
|
175
|
+
category_id int NOT NULL,
|
176
|
+
post_id int NOT NULL
|
177
|
+
)
|
178
|
+
|
179
|
+
CREATE TABLE fk_test_has_pk (
|
180
|
+
id int IDENTITY PRIMARY KEY
|
181
|
+
)
|
182
|
+
|
183
|
+
CREATE TABLE fk_test_has_fk (
|
184
|
+
id numeric(9,0) PRIMARY KEY,
|
185
|
+
fk_id numeric(9,0) NOT NULL,
|
186
|
+
|
187
|
+
FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
|
188
|
+
)
|
189
|
+
|
190
|
+
|
191
|
+
CREATE TABLE keyboards (
|
192
|
+
key_number int IDENTITY PRIMARY KEY,
|
193
|
+
name varchar(50) NULL
|
194
|
+
)
|
195
|
+
|
196
|
+
--This table has an altered lock_version column name.
|
197
|
+
CREATE TABLE legacy_things (
|
198
|
+
id int IDENTITY PRIMARY KEY,
|
199
|
+
tps_report_number int default NULL,
|
200
|
+
version int default 0
|
201
|
+
)
|
202
|
+
|
203
|
+
|
204
|
+
CREATE TABLE numeric_data (
|
205
|
+
id int IDENTITY PRIMARY KEY,
|
206
|
+
bank_balance numeric(10,2),
|
207
|
+
big_bank_balance numeric(15,2),
|
208
|
+
world_population numeric(10),
|
209
|
+
my_house_population numeric(2),
|
210
|
+
decimal_number_with_default numeric(3,2) DEFAULT 2.78
|
211
|
+
)
|
212
|
+
|
213
|
+
CREATE TABLE mixed_case_monkeys (
|
214
|
+
monkeyID int IDENTITY PRIMARY KEY,
|
215
|
+
fleaCount int NULL
|
216
|
+
)
|
217
|
+
|
218
|
+
CREATE TABLE minimalistics (
|
219
|
+
id int IDENTITY PRIMARY KEY
|
220
|
+
)
|
221
|
+
|
222
|
+
go
|