activerecord-odbc-adapter 2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/AUTHORS +16 -0
  2. data/COPYING +21 -0
  3. data/ChangeLog +139 -0
  4. data/LICENSE +5 -0
  5. data/NEWS +25 -0
  6. data/README +229 -0
  7. data/lib/active_record/connection_adapters/odbc_adapter.rb +1950 -0
  8. data/lib/active_record/vendor/odbcext_db2.rb +87 -0
  9. data/lib/active_record/vendor/odbcext_informix.rb +144 -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 +216 -0
  13. data/lib/active_record/vendor/odbcext_microsoftsqlserver_col.rb +40 -0
  14. data/lib/active_record/vendor/odbcext_mysql.rb +174 -0
  15. data/lib/active_record/vendor/odbcext_oracle.rb +219 -0
  16. data/lib/active_record/vendor/odbcext_postgresql.rb +158 -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_sqlanywhere.rb +115 -0
  20. data/lib/active_record/vendor/odbcext_sqlanywhere_col.rb +49 -0
  21. data/lib/active_record/vendor/odbcext_sybase.rb +213 -0
  22. data/lib/active_record/vendor/odbcext_sybase_col.rb +49 -0
  23. data/lib/active_record/vendor/odbcext_virtuoso.rb +158 -0
  24. data/lib/odbc_adapter.rb +28 -0
  25. data/support/lib/active_record/connection_adapters/abstract/schema_definitions.rb +259 -0
  26. data/support/odbc_rails.diff +367 -0
  27. data/support/pack_odbc.rb +119 -0
  28. data/support/rake/rails_plugin_package_task.rb +212 -0
  29. data/support/rake_fixes/README +6 -0
  30. data/support/rake_fixes/databases.dif +13 -0
  31. data/support/test/base_test.rb +1765 -0
  32. data/support/test/migration_test.rb +1007 -0
  33. data/test/connections/native_odbc/connection.rb +137 -0
  34. data/test/fixtures/db_definitions/db2.drop.sql +33 -0
  35. data/test/fixtures/db_definitions/db2.sql +237 -0
  36. data/test/fixtures/db_definitions/db22.drop.sql +2 -0
  37. data/test/fixtures/db_definitions/db22.sql +5 -0
  38. data/test/fixtures/db_definitions/informix.drop.sql +33 -0
  39. data/test/fixtures/db_definitions/informix.sql +223 -0
  40. data/test/fixtures/db_definitions/informix2.drop.sql +2 -0
  41. data/test/fixtures/db_definitions/informix2.sql +5 -0
  42. data/test/fixtures/db_definitions/ingres.drop.sql +68 -0
  43. data/test/fixtures/db_definitions/ingres.sql +252 -0
  44. data/test/fixtures/db_definitions/ingres2.drop.sql +2 -0
  45. data/test/fixtures/db_definitions/ingres2.sql +5 -0
  46. data/test/fixtures/db_definitions/mysql.drop.sql +33 -0
  47. data/test/fixtures/db_definitions/mysql.sql +238 -0
  48. data/test/fixtures/db_definitions/mysql2.drop.sql +2 -0
  49. data/test/fixtures/db_definitions/mysql2.sql +5 -0
  50. data/test/fixtures/db_definitions/oracle_odbc.drop.sql +72 -0
  51. data/test/fixtures/db_definitions/oracle_odbc.sql +296 -0
  52. data/test/fixtures/db_definitions/oracle_odbc2.drop.sql +2 -0
  53. data/test/fixtures/db_definitions/oracle_odbc2.sql +6 -0
  54. data/test/fixtures/db_definitions/postgresql.drop.sql +38 -0
  55. data/test/fixtures/db_definitions/postgresql.sql +267 -0
  56. data/test/fixtures/db_definitions/postgresql2.drop.sql +2 -0
  57. data/test/fixtures/db_definitions/postgresql2.sql +5 -0
  58. data/test/fixtures/db_definitions/progress.drop.sql +67 -0
  59. data/test/fixtures/db_definitions/progress.sql +255 -0
  60. data/test/fixtures/db_definitions/progress2.drop.sql +2 -0
  61. data/test/fixtures/db_definitions/progress2.sql +6 -0
  62. data/test/fixtures/db_definitions/sqlserver.drop.sql +35 -0
  63. data/test/fixtures/db_definitions/sqlserver.sql +247 -0
  64. data/test/fixtures/db_definitions/sqlserver2.drop.sql +2 -0
  65. data/test/fixtures/db_definitions/sqlserver2.sql +5 -0
  66. data/test/fixtures/db_definitions/sybase.drop.sql +35 -0
  67. data/test/fixtures/db_definitions/sybase.sql +222 -0
  68. data/test/fixtures/db_definitions/sybase2.drop.sql +4 -0
  69. data/test/fixtures/db_definitions/sybase2.sql +5 -0
  70. data/test/fixtures/db_definitions/virtuoso.drop.sql +33 -0
  71. data/test/fixtures/db_definitions/virtuoso.sql +218 -0
  72. data/test/fixtures/db_definitions/virtuoso2.drop.sql +2 -0
  73. data/test/fixtures/db_definitions/virtuoso2.sql +5 -0
  74. metadata +166 -0
@@ -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,33 @@
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;
@@ -0,0 +1,238 @@
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 DEFAULT CHARSET=utf8;
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 auto_increment 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 auto_increment 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 auto_increment 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 auto_increment PRIMARY KEY,
159
+ `author_id` INTEGER,
160
+ `title` VARCHAR(255) NOT NULL,
161
+ `body` TEXT NOT NULL,
162
+ `type` VARCHAR(255) default NULL
163
+ ) TYPE=InnoDB;
164
+
165
+ CREATE TABLE `comments` (
166
+ `id` INTEGER NOT NULL auto_increment PRIMARY KEY,
167
+ `post_id` INTEGER NOT NULL,
168
+ `body` TEXT NOT NULL,
169
+ `type` VARCHAR(255) default NULL
170
+ ) TYPE=InnoDB;
171
+
172
+ CREATE TABLE `authors` (
173
+ `id` INTEGER NOT NULL auto_increment 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) default 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 auto_increment PRIMARY KEY
198
+ ) TYPE=InnoDB;
199
+
200
+ CREATE TABLE `fk_test_has_fk` (
201
+ `id` INTEGER NOT NULL auto_increment 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;
220
+
221
+ CREATE TABLE `numeric_data` (
222
+ `id` INTEGER NOT NULL auto_increment PRIMARY KEY,
223
+ `bank_balance` decimal(10,2),
224
+ `big_bank_balance` decimal(15,2),
225
+ `world_population` decimal(10),
226
+ `my_house_population` decimal(2),
227
+ `decimal_number_with_default` decimal(3,2) DEFAULT 2.78
228
+ ) TYPE=InnoDB;
229
+
230
+ CREATE TABLE `mixed_case_monkeys` (
231
+ `monkeyID` int(11) NOT NULL auto_increment,
232
+ `fleaCount` int(11) default NULL,
233
+ PRIMARY KEY (`monkeyID`)
234
+ ) TYPE=InnoDB;
235
+
236
+ CREATE TABLE `minimalistics` (
237
+ `id` int(11) NOT NULL auto_increment PRIMARY KEY
238
+ ) TYPE=InnoDB;
@@ -0,0 +1,2 @@
1
+ DROP TABLE courses;
2
+
@@ -0,0 +1,5 @@
1
+ CREATE TABLE `courses` (
2
+ `id` INTEGER NOT NULL PRIMARY KEY,
3
+ `name` VARCHAR(255) NOT NULL
4
+ ) TYPE=InnoDB;
5
+
@@ -0,0 +1,72 @@
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 defaults;
16
+ drop table auto_id_tests;
17
+ drop table entrants;
18
+ drop table colnametests;
19
+ drop table mixins;
20
+ drop table people;
21
+ drop table readers;
22
+ drop table binaries;
23
+ drop table comments;
24
+ drop table authors;
25
+ drop table tasks;
26
+ drop table categories_posts;
27
+ drop table categories;
28
+ drop table posts;
29
+ drop table fk_test_has_pk;
30
+ drop table fk_test_has_fk;
31
+ drop table keyboards;
32
+ drop table legacy_things;
33
+ drop table numeric_data;
34
+ drop table mixed_case_monkeys;
35
+ drop table minimalistics;
36
+ drop table test_oracle_defaults;
37
+
38
+ drop sequence accounts_seq;
39
+ drop sequence funny_jokes_seq;
40
+ drop sequence companies_nonstd_seq;
41
+ drop sequence topics_seq;
42
+ drop sequence developers_seq;
43
+ drop sequence projects_seq;
44
+ drop sequence developers_projects_seq;
45
+ drop sequence customers_seq;
46
+ drop sequence orders_seq;
47
+ drop sequence movies_seq;
48
+ drop sequence subscribers_seq;
49
+ drop sequence booleantests_seq;
50
+ drop sequence defaults_seq;
51
+ drop sequence auto_id_tests_seq;
52
+ drop sequence entrants_seq;
53
+ drop sequence colnametests_seq;
54
+ drop sequence mixins_seq;
55
+ drop sequence people_seq;
56
+ drop sequence readers_seq;
57
+ drop sequence binaries_seq;
58
+ drop sequence posts_seq;
59
+ drop sequence comments_seq;
60
+ drop sequence authors_seq;
61
+ drop sequence tasks_seq;
62
+ drop sequence computers_seq;
63
+ drop sequence categories_seq;
64
+ drop sequence categories_posts_seq;
65
+ drop sequence fk_test_has_pk_seq;
66
+ drop sequence fk_test_has_fk_seq;
67
+ drop sequence keyboards_seq;
68
+ drop sequence legacy_things_seq;
69
+ drop sequence numeric_data_seq;
70
+ drop sequence mixed_case_monkeys_seq;
71
+ drop sequence minimalistics_seq;
72
+ drop sequence test_oracle_defaults_seq;
@@ -0,0 +1,296 @@
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(1) 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 defaults (
119
+ id number(10) not null,
120
+ modified_date date default sysdate,
121
+ modified_date_function date default sysdate,
122
+ fixed_date date default to_date('2004-01-01', 'YYYY-MM-DD'),
123
+ modified_time date default sysdate,
124
+ modified_time_function date default sysdate,
125
+ fixed_time date default TO_DATE('2004-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'),
126
+ char1 varchar2(1) default 'Y',
127
+ char2 varchar2(50) default 'a varchar field',
128
+ char3 clob default 'a text field',
129
+ positive_integer number(10) default 1,
130
+ negative_integer number(10) default -1,
131
+ decimal_number number(3,2) default 2.78
132
+ );
133
+ create sequence defaults_seq minvalue 10000;
134
+
135
+ create table auto_id_tests (
136
+ auto_id number(10) not null,
137
+ value number(10) default null,
138
+ primary key (auto_id)
139
+ );
140
+ create sequence auto_id_tests_seq minvalue 10000;
141
+
142
+ create table entrants (
143
+ id number(10) not null primary key,
144
+ name varchar(255) not null,
145
+ course_id number(10) not null
146
+ );
147
+ create sequence entrants_seq minvalue 10000;
148
+
149
+ create table colnametests (
150
+ id number(10) not null,
151
+ references number(10) not null,
152
+ primary key (id)
153
+ );
154
+ create sequence colnametests_seq minvalue 10000;
155
+
156
+ create table mixins (
157
+ id number(10) not null,
158
+ parent_id number(10) default null references mixins initially deferred disable,
159
+ type varchar(40) default null,
160
+ pos number(10) default null,
161
+ lft number(10) default null,
162
+ rgt number(10) default null,
163
+ root_id number(10) default null,
164
+ created_at timestamp default null,
165
+ updated_at timestamp default null,
166
+ primary key (id)
167
+ );
168
+ create sequence mixins_seq minvalue 10000;
169
+
170
+ create table people (
171
+ id number(10) not null,
172
+ first_name varchar(40) null,
173
+ lock_version number(10) default 0,
174
+ primary key (id)
175
+ );
176
+ create sequence people_seq minvalue 10000;
177
+
178
+ create table readers (
179
+ id number(10) not null,
180
+ post_id number(10) not null,
181
+ person_id number(10) not null,
182
+ primary key (id)
183
+ );
184
+ create sequence readers_seq minvalue 10000;
185
+
186
+ create table binaries (
187
+ id number(10) not null,
188
+ data blob null,
189
+ primary key (id)
190
+ );
191
+ create sequence binaries_seq minvalue 10000;
192
+
193
+ create table computers (
194
+ id number(10) not null primary key,
195
+ developer number(10) not null references developers initially deferred disable,
196
+ "extendedWarranty" number(10) not null
197
+ );
198
+ create sequence computers_seq minvalue 10000;
199
+
200
+ create table posts (
201
+ id number(10) not null primary key,
202
+ author_id number(10) default null,
203
+ title varchar(255) default null,
204
+ type varchar(255) default null,
205
+ body varchar(3000) default null
206
+ );
207
+ create sequence posts_seq minvalue 10000;
208
+
209
+ create table comments (
210
+ id number(10) not null primary key,
211
+ post_id number(10) default null,
212
+ type varchar(255) default null,
213
+ body varchar(3000) default null
214
+ );
215
+ create sequence comments_seq minvalue 10000;
216
+
217
+ create table authors (
218
+ id number(10) not null primary key,
219
+ name varchar(255) default null
220
+ );
221
+ create sequence authors_seq minvalue 10000;
222
+
223
+ create table tasks (
224
+ id number(10) not null primary key,
225
+ starting date default null,
226
+ ending date default null
227
+ );
228
+ create sequence tasks_seq minvalue 10000;
229
+
230
+ create table categories (
231
+ id number(10) not null primary key,
232
+ name varchar(255) default null,
233
+ type varchar(255) default null
234
+ );
235
+ create sequence categories_seq minvalue 10000;
236
+
237
+ create table categories_posts (
238
+ category_id number(10) not null references categories initially deferred disable,
239
+ post_id number(10) not null references posts initially deferred disable
240
+ );
241
+ create sequence categories_posts_seq minvalue 10000;
242
+
243
+ create table fk_test_has_pk (
244
+ id number(10) not null primary key
245
+ );
246
+ create sequence fk_test_has_pk_seq minvalue 10000;
247
+
248
+ create table fk_test_has_fk (
249
+ id number(10) not null primary key,
250
+ fk_id number(10) not null references fk_test_has_fk initially deferred disable
251
+ );
252
+ create sequence fk_test_has_fk_seq minvalue 10000;
253
+
254
+ create table keyboards (
255
+ key_number number(10) not null,
256
+ name varchar(50) default null
257
+ );
258
+ create sequence keyboards_seq minvalue 10000;
259
+
260
+ create table test_oracle_defaults (
261
+ id number(10) not null primary key,
262
+ test_char char(1) default 'X' not null,
263
+ test_string varchar2(20) default 'hello' not null,
264
+ test_int number(10) default 3 not null
265
+ );
266
+ create sequence test_oracle_defaults_seq minvalue 10000;
267
+
268
+ --This table has an altered lock_version column name.
269
+ create table legacy_things (
270
+ id number(10) not null primary key,
271
+ tps_report_number number(10) default null,
272
+ version number(10) default 0
273
+ );
274
+ create sequence legacy_things_seq minvalue 10000;
275
+
276
+ create table numeric_data (
277
+ id number(10) not null primary key,
278
+ bank_balance decimal(10,2),
279
+ big_bank_balance decimal(15,2),
280
+ world_population decimal(10),
281
+ my_house_population decimal(2),
282
+ decimal_number_with_default decimal(3,2) default 2.78
283
+ );
284
+ create sequence numeric_data_seq minvalue 10000;
285
+
286
+ create table mixed_case_monkeys (
287
+ "monkeyID" number(10) not null,
288
+ "fleaCount" number(10) default null,
289
+ primary key (monkeyID)
290
+ );
291
+ create sequence mixed_case_monkeys_seq minvalue 10000;
292
+
293
+ create table minimalistics (
294
+ id number(10) not null primary key
295
+ );
296
+ create sequence minimalistics_seq minvalue 10000;