odbc-rails 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/AUTHORS +16 -0
  2. data/COPYING +21 -0
  3. data/ChangeLog +89 -0
  4. data/LICENSE +5 -0
  5. data/NEWS +12 -0
  6. data/README +282 -0
  7. data/lib/active_record/connection_adapters/odbc_adapter.rb +1792 -0
  8. data/lib/active_record/vendor/odbcext_db2.rb +87 -0
  9. data/lib/active_record/vendor/odbcext_informix.rb +132 -0
  10. data/lib/active_record/vendor/odbcext_informix_col.rb +45 -0
  11. data/lib/active_record/vendor/odbcext_ingres.rb +156 -0
  12. data/lib/active_record/vendor/odbcext_microsoftsqlserver.rb +185 -0
  13. data/lib/active_record/vendor/odbcext_microsoftsqlserver_col.rb +40 -0
  14. data/lib/active_record/vendor/odbcext_mysql.rb +136 -0
  15. data/lib/active_record/vendor/odbcext_oracle.rb +220 -0
  16. data/lib/active_record/vendor/odbcext_postgresql.rb +179 -0
  17. data/lib/active_record/vendor/odbcext_progress.rb +139 -0
  18. data/lib/active_record/vendor/odbcext_progress89.rb +259 -0
  19. data/lib/active_record/vendor/odbcext_sybase.rb +212 -0
  20. data/lib/active_record/vendor/odbcext_sybase_col.rb +49 -0
  21. data/lib/active_record/vendor/odbcext_virtuoso.rb +146 -0
  22. data/lib/odbc_adapter.rb +28 -0
  23. data/support/lib/active_record/connection_adapters/abstract/schema_definitions.rb +259 -0
  24. data/support/odbc_rails.diff +707 -0
  25. data/support/pack_odbc.rb +119 -0
  26. data/support/rake/rails_plugin_package_task.rb +212 -0
  27. data/support/test/base_test.rb +1349 -0
  28. data/support/test/migration_test.rb +566 -0
  29. data/test/connections/native_odbc/connection.rb +95 -0
  30. data/test/fixtures/db_definitions/db2.drop.sql +30 -0
  31. data/test/fixtures/db_definitions/db2.sql +217 -0
  32. data/test/fixtures/db_definitions/db22.drop.sql +2 -0
  33. data/test/fixtures/db_definitions/db22.sql +5 -0
  34. data/test/fixtures/db_definitions/informix.drop.sql +30 -0
  35. data/test/fixtures/db_definitions/informix.sql +205 -0
  36. data/test/fixtures/db_definitions/informix2.drop.sql +2 -0
  37. data/test/fixtures/db_definitions/informix2.sql +5 -0
  38. data/test/fixtures/db_definitions/ingres.drop.sql +62 -0
  39. data/test/fixtures/db_definitions/ingres.sql +232 -0
  40. data/test/fixtures/db_definitions/ingres2.drop.sql +2 -0
  41. data/test/fixtures/db_definitions/ingres2.sql +5 -0
  42. data/test/fixtures/db_definitions/mysql.drop.sql +30 -0
  43. data/test/fixtures/db_definitions/mysql.sql +219 -0
  44. data/test/fixtures/db_definitions/mysql2.drop.sql +2 -0
  45. data/test/fixtures/db_definitions/mysql2.sql +5 -0
  46. data/test/fixtures/db_definitions/oracle_odbc.drop.sql +64 -0
  47. data/test/fixtures/db_definitions/oracle_odbc.sql +257 -0
  48. data/test/fixtures/db_definitions/oracle_odbc2.drop.sql +2 -0
  49. data/test/fixtures/db_definitions/oracle_odbc2.sql +6 -0
  50. data/test/fixtures/db_definitions/progress.drop.sql +61 -0
  51. data/test/fixtures/db_definitions/progress.sql +234 -0
  52. data/test/fixtures/db_definitions/progress2.drop.sql +2 -0
  53. data/test/fixtures/db_definitions/progress2.sql +6 -0
  54. data/test/fixtures/db_definitions/sqlserver.drop.sql +30 -0
  55. data/test/fixtures/db_definitions/sqlserver.sql +203 -0
  56. data/test/fixtures/db_definitions/sqlserver2.drop.sql +2 -0
  57. data/test/fixtures/db_definitions/sqlserver2.sql +5 -0
  58. data/test/fixtures/db_definitions/sybase.drop.sql +31 -0
  59. data/test/fixtures/db_definitions/sybase.sql +204 -0
  60. data/test/fixtures/db_definitions/sybase2.drop.sql +4 -0
  61. data/test/fixtures/db_definitions/sybase2.sql +5 -0
  62. data/test/fixtures/db_definitions/virtuoso.drop.sql +30 -0
  63. data/test/fixtures/db_definitions/virtuoso.sql +200 -0
  64. data/test/fixtures/db_definitions/virtuoso2.drop.sql +2 -0
  65. data/test/fixtures/db_definitions/virtuoso2.sql +5 -0
  66. metadata +149 -0
@@ -0,0 +1,2 @@
1
+ DROP TABLE courses;
2
+
@@ -0,0 +1,5 @@
1
+ CREATE TABLE courses (
2
+ id int PRIMARY KEY,
3
+ name varchar(255) NOT NULL
4
+ );
5
+
@@ -0,0 +1,62 @@
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
+
32
+ drop sequence accounts_seq;
33
+ drop sequence funny_jokes_seq;
34
+ drop sequence companies_nonstd_seq;
35
+ drop sequence topics_seq;
36
+ drop sequence developers_seq;
37
+ drop sequence projects_seq;
38
+ drop sequence developers_projects_seq;
39
+ drop sequence customers_seq;
40
+ drop sequence orders_seq;
41
+ drop sequence movies_seq;
42
+ drop sequence subscribers_seq;
43
+ drop sequence booleantests_seq;
44
+ drop sequence auto_id_tests_seq;
45
+ drop sequence entrants_seq;
46
+ drop sequence colnametests_seq;
47
+ drop sequence mixins_seq;
48
+ drop sequence people_seq;
49
+ drop sequence readers_seq;
50
+ drop sequence binaries_seq;
51
+ drop sequence computers_seq;
52
+ drop sequence posts_seq;
53
+ drop sequence comments_seq;
54
+ drop sequence authors_seq;
55
+ drop sequence tasks_seq;
56
+ drop sequence categories_seq;
57
+ drop sequence categories_posts_seq;
58
+ drop sequence fk_test_has_pk_seq;
59
+ drop sequence fk_test_has_fk_seq;
60
+ drop sequence keyboards_seq;
61
+ drop sequence legacy_things_seq;
62
+
@@ -0,0 +1,232 @@
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
+
@@ -0,0 +1,2 @@
1
+ drop table courses;
2
+ drop sequence courses_seq;
@@ -0,0 +1,5 @@
1
+ CREATE TABLE courses (
2
+ id INTEGER PRIMARY KEY NOT NULL,
3
+ name VARCHAR(255) NOT NULL
4
+ ) WITH PAGE_SIZE=8192;
5
+ CREATE SEQUENCE courses_seq MINVALUE 10000;
@@ -0,0 +1,30 @@
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;
@@ -0,0 +1,219 @@
1
+ CREATE TABLE `accounts` (
2
+ `id` int(11) NOT NULL auto_increment,
3
+ `firm_id` int(11) default NULL,
4
+ `credit_limit` int(5) default NULL,
5
+ PRIMARY KEY (`id`)
6
+ ) TYPE=InnoDB;
7
+
8
+ CREATE TABLE `funny_jokes` (
9
+ `id` int(11) NOT NULL auto_increment,
10
+ `name` varchar(50) default NULL,
11
+ PRIMARY KEY (`id`)
12
+ ) TYPE=InnoDB;
13
+
14
+ CREATE TABLE `companies` (
15
+ `id` int(11) NOT NULL auto_increment,
16
+ `type` varchar(50) default NULL,
17
+ `ruby_type` varchar(50) default NULL,
18
+ `firm_id` int(11) default NULL,
19
+ `name` varchar(50) default NULL,
20
+ `client_of` int(11) default NULL,
21
+ `rating` int(11) default NULL default 1,
22
+ PRIMARY KEY (`id`)
23
+ ) TYPE=InnoDB;
24
+
25
+
26
+ CREATE TABLE `topics` (
27
+ `id` int(11) NOT NULL auto_increment,
28
+ `title` varchar(255) default NULL,
29
+ `author_name` varchar(255) default NULL,
30
+ `author_email_address` varchar(255) default NULL,
31
+ `written_on` datetime default NULL,
32
+ `bonus_time` time default NULL,
33
+ `last_read` date default NULL,
34
+ `content` text,
35
+ `approved` tinyint(1) default 1,
36
+ `replies_count` int(11) default 0,
37
+ `parent_id` int(11) default NULL,
38
+ `type` varchar(50) default NULL,
39
+ PRIMARY KEY (`id`)
40
+ ) TYPE=InnoDB;
41
+
42
+ CREATE TABLE `developers` (
43
+ `id` int(11) NOT NULL auto_increment,
44
+ `name` varchar(100) default NULL,
45
+ `salary` int(11) default 70000,
46
+ `created_at` datetime default NULL,
47
+ `updated_at` datetime default NULL,
48
+ PRIMARY KEY (`id`)
49
+ ) TYPE=InnoDB;
50
+
51
+ CREATE TABLE `projects` (
52
+ `id` int(11) NOT NULL auto_increment,
53
+ `name` varchar(100) default NULL,
54
+ `type` VARCHAR(255) default NULL,
55
+ PRIMARY KEY (`id`)
56
+ ) TYPE=InnoDB;
57
+
58
+ CREATE TABLE `developers_projects` (
59
+ `developer_id` int(11) NOT NULL,
60
+ `project_id` int(11) NOT NULL,
61
+ `joined_on` date default NULL,
62
+ `access_level` smallint default 1
63
+ ) TYPE=InnoDB;
64
+
65
+ CREATE TABLE `orders` (
66
+ `id` int(11) NOT NULL auto_increment,
67
+ `name` varchar(100) default NULL,
68
+ `billing_customer_id` int(11) default NULL,
69
+ `shipping_customer_id` int(11) default NULL,
70
+ PRIMARY KEY (`id`)
71
+ ) TYPE=InnoDB;
72
+
73
+ CREATE TABLE `customers` (
74
+ `id` int(11) NOT NULL auto_increment,
75
+ `name` varchar(100) default NULL,
76
+ `balance` int(6) default 0,
77
+ `address_street` varchar(100) default NULL,
78
+ `address_city` varchar(100) default NULL,
79
+ `address_country` varchar(100) default NULL,
80
+ `gps_location` varchar(100) default NULL,
81
+ PRIMARY KEY (`id`)
82
+ ) TYPE=InnoDB;
83
+
84
+ CREATE TABLE `movies` (
85
+ `movieid` int(11) NOT NULL auto_increment,
86
+ `name` varchar(100) default NULL,
87
+ PRIMARY KEY (`movieid`)
88
+ ) TYPE=InnoDB;
89
+
90
+ CREATE TABLE `subscribers` (
91
+ `nick` varchar(100) NOT NULL,
92
+ `name` varchar(100) default NULL,
93
+ PRIMARY KEY (`nick`)
94
+ ) TYPE=InnoDB;
95
+
96
+ CREATE TABLE `booleantests` (
97
+ `id` int(11) NOT NULL auto_increment,
98
+ `value` integer default NULL,
99
+ PRIMARY KEY (`id`)
100
+ ) TYPE=InnoDB;
101
+
102
+ CREATE TABLE `auto_id_tests` (
103
+ `auto_id` int(11) NOT NULL auto_increment,
104
+ `value` integer default NULL,
105
+ PRIMARY KEY (`auto_id`)
106
+ ) TYPE=InnoDB;
107
+
108
+ CREATE TABLE `entrants` (
109
+ `id` INTEGER NOT NULL PRIMARY KEY,
110
+ `name` VARCHAR(255) NOT NULL,
111
+ `course_id` INTEGER NOT NULL
112
+ );
113
+
114
+ CREATE TABLE `colnametests` (
115
+ `id` int(11) NOT NULL auto_increment,
116
+ `references` int(11) NOT NULL,
117
+ PRIMARY KEY (`id`)
118
+ ) TYPE=InnoDB;
119
+
120
+ CREATE TABLE `mixins` (
121
+ `id` int(11) NOT NULL auto_increment,
122
+ `parent_id` int(11) default NULL,
123
+ `pos` int(11) default NULL,
124
+ `created_at` datetime default NULL,
125
+ `updated_at` datetime default NULL,
126
+ `lft` int(11) default NULL,
127
+ `rgt` int(11) default NULL,
128
+ `root_id` int(11) default NULL,
129
+ `type` varchar(40) default NULL,
130
+ PRIMARY KEY (`id`)
131
+ ) TYPE=InnoDB;
132
+
133
+ CREATE TABLE `people` (
134
+ `id` INTEGER NOT NULL auto_increment PRIMARY KEY,
135
+ `first_name` VARCHAR(40) NOT NULL,
136
+ `lock_version` INTEGER NOT NULL DEFAULT 0
137
+ ) TYPE=InnoDB;
138
+
139
+ CREATE TABLE `readers` (
140
+ `id` int(11) NOT NULL PRIMARY KEY,
141
+ `post_id` INTEGER NOT NULL,
142
+ `person_id` INTEGER NOT NULL
143
+ ) TYPE=InnoDB;
144
+
145
+ CREATE TABLE `binaries` (
146
+ `id` int(11) NOT NULL auto_increment,
147
+ `data` mediumblob,
148
+ PRIMARY KEY (`id`)
149
+ ) TYPE=InnoDB;
150
+
151
+ CREATE TABLE `computers` (
152
+ `id` INTEGER NOT NULL PRIMARY KEY,
153
+ `developer` INTEGER NOT NULL,
154
+ `extendedWarranty` INTEGER NOT NULL
155
+ ) TYPE=InnoDB;
156
+
157
+ CREATE TABLE `posts` (
158
+ `id` INTEGER NOT NULL PRIMARY KEY,
159
+ `author_id` INTEGER,
160
+ `title` VARCHAR(255) NOT NULL,
161
+ `body` TEXT NOT NULL,
162
+ `type` VARCHAR(255) NOT NULL
163
+ ) TYPE=InnoDB;
164
+
165
+ CREATE TABLE `comments` (
166
+ `id` INTEGER NOT NULL PRIMARY KEY,
167
+ `post_id` INTEGER NOT NULL,
168
+ `body` TEXT NOT NULL,
169
+ `type` VARCHAR(255) NOT NULL
170
+ ) TYPE=InnoDB;
171
+
172
+ CREATE TABLE `authors` (
173
+ `id` INTEGER NOT NULL PRIMARY KEY,
174
+ `name` VARCHAR(255) NOT NULL
175
+ ) TYPE=InnoDB;
176
+
177
+ CREATE TABLE `tasks` (
178
+ `id` int(11) NOT NULL auto_increment,
179
+ `starting` datetime NOT NULL default '0000-00-00 00:00:00',
180
+ `ending` datetime NOT NULL default '0000-00-00 00:00:00',
181
+ PRIMARY KEY (`id`)
182
+ ) TYPE=InnoDB;
183
+
184
+ CREATE TABLE `categories` (
185
+ `id` int(11) NOT NULL auto_increment,
186
+ `name` VARCHAR(255) NOT NULL,
187
+ `type` VARCHAR(255) NOT NULL,
188
+ PRIMARY KEY (`id`)
189
+ ) TYPE=InnoDB;
190
+
191
+ CREATE TABLE `categories_posts` (
192
+ `category_id` int(11) NOT NULL,
193
+ `post_id` int(11) NOT NULL
194
+ ) TYPE=InnoDB;
195
+
196
+ CREATE TABLE `fk_test_has_pk` (
197
+ `id` INTEGER NOT NULL PRIMARY KEY
198
+ ) TYPE=InnoDB;
199
+
200
+ CREATE TABLE `fk_test_has_fk` (
201
+ `id` INTEGER NOT NULL PRIMARY KEY,
202
+ `fk_id` INTEGER NOT NULL,
203
+
204
+ FOREIGN KEY (`fk_id`) REFERENCES `fk_test_has_pk`(`id`)
205
+ ) TYPE=InnoDB;
206
+
207
+
208
+ CREATE TABLE `keyboards` (
209
+ `key_number` int(11) NOT NULL auto_increment primary key,
210
+ `name` varchar(50) default NULL
211
+ );
212
+
213
+ -- Altered lock_version column name.
214
+ CREATE TABLE `legacy_things` (
215
+ `id` int(11) NOT NULL auto_increment,
216
+ `tps_report_number` int(11) default NULL,
217
+ `version` int(11) NOT NULL default 0,
218
+ PRIMARY KEY (`id`)
219
+ ) TYPE=InnoDB;