activerecord 1.13.2 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activerecord might be problematic. Click here for more details.

Files changed (144) hide show
  1. data/CHANGELOG +452 -10
  2. data/RUNNING_UNIT_TESTS +1 -1
  3. data/lib/active_record.rb +5 -2
  4. data/lib/active_record/acts/list.rb +1 -1
  5. data/lib/active_record/acts/tree.rb +29 -25
  6. data/lib/active_record/aggregations.rb +3 -2
  7. data/lib/active_record/associations.rb +783 -337
  8. data/lib/active_record/associations/association_collection.rb +7 -12
  9. data/lib/active_record/associations/association_proxy.rb +62 -24
  10. data/lib/active_record/associations/belongs_to_association.rb +27 -46
  11. data/lib/active_record/associations/belongs_to_polymorphic_association.rb +50 -0
  12. data/lib/active_record/associations/has_and_belongs_to_many_association.rb +38 -38
  13. data/lib/active_record/associations/has_many_association.rb +61 -56
  14. data/lib/active_record/associations/has_many_through_association.rb +144 -0
  15. data/lib/active_record/associations/has_one_association.rb +22 -16
  16. data/lib/active_record/base.rb +482 -182
  17. data/lib/active_record/calculations.rb +225 -0
  18. data/lib/active_record/callbacks.rb +7 -7
  19. data/lib/active_record/connection_adapters/abstract/connection_specification.rb +162 -47
  20. data/lib/active_record/connection_adapters/abstract/quoting.rb +1 -1
  21. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +2 -1
  22. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +21 -1
  23. data/lib/active_record/connection_adapters/abstract_adapter.rb +34 -2
  24. data/lib/active_record/connection_adapters/db2_adapter.rb +107 -61
  25. data/lib/active_record/connection_adapters/mysql_adapter.rb +29 -6
  26. data/lib/active_record/connection_adapters/openbase_adapter.rb +349 -0
  27. data/lib/active_record/connection_adapters/{oci_adapter.rb → oracle_adapter.rb} +125 -59
  28. data/lib/active_record/connection_adapters/postgresql_adapter.rb +24 -21
  29. data/lib/active_record/connection_adapters/sqlite_adapter.rb +47 -8
  30. data/lib/active_record/connection_adapters/sqlserver_adapter.rb +36 -16
  31. data/lib/active_record/connection_adapters/sybase_adapter.rb +684 -0
  32. data/lib/active_record/fixtures.rb +42 -17
  33. data/lib/active_record/locking.rb +36 -15
  34. data/lib/active_record/migration.rb +111 -8
  35. data/lib/active_record/observer.rb +25 -1
  36. data/lib/active_record/reflection.rb +103 -41
  37. data/lib/active_record/schema.rb +2 -2
  38. data/lib/active_record/schema_dumper.rb +55 -18
  39. data/lib/active_record/timestamp.rb +6 -6
  40. data/lib/active_record/validations.rb +65 -40
  41. data/lib/active_record/vendor/db2.rb +10 -5
  42. data/lib/active_record/vendor/simple.rb +693 -702
  43. data/lib/active_record/version.rb +2 -2
  44. data/rakefile +4 -4
  45. data/test/aaa_create_tables_test.rb +25 -6
  46. data/test/abstract_unit.rb +39 -1
  47. data/test/adapter_test.rb +31 -4
  48. data/test/associations_cascaded_eager_loading_test.rb +106 -0
  49. data/test/associations_go_eager_test.rb +85 -16
  50. data/test/associations_join_model_test.rb +338 -0
  51. data/test/associations_test.rb +129 -50
  52. data/test/base_test.rb +204 -49
  53. data/test/binary_test.rb +1 -1
  54. data/test/calculations_test.rb +169 -0
  55. data/test/callbacks_test.rb +5 -23
  56. data/test/class_inheritable_attributes_test.rb +1 -1
  57. data/test/column_alias_test.rb +1 -1
  58. data/test/connections/native_mysql/connection.rb +1 -0
  59. data/test/connections/native_openbase/connection.rb +22 -0
  60. data/test/connections/{native_oci → native_oracle}/connection.rb +7 -9
  61. data/test/connections/native_sqlite/connection.rb +1 -1
  62. data/test/connections/native_sqlite3/connection.rb +1 -0
  63. data/test/connections/native_sqlite3/in_memory_connection.rb +1 -0
  64. data/test/connections/native_sybase/connection.rb +24 -0
  65. data/test/defaults_test.rb +18 -0
  66. data/test/deprecated_associations_test.rb +2 -2
  67. data/test/deprecated_finder_test.rb +0 -6
  68. data/test/finder_test.rb +26 -23
  69. data/test/fixtures/accounts.yml +10 -0
  70. data/test/fixtures/author.rb +31 -6
  71. data/test/fixtures/author_favorites.yml +4 -0
  72. data/test/fixtures/categories/special_categories.yml +9 -0
  73. data/test/fixtures/categories/subsubdir/arbitrary_filename.yml +4 -0
  74. data/test/fixtures/categories_posts.yml +4 -0
  75. data/test/fixtures/categorization.rb +5 -0
  76. data/test/fixtures/categorizations.yml +11 -0
  77. data/test/fixtures/category.rb +6 -0
  78. data/test/fixtures/company.rb +17 -5
  79. data/test/fixtures/company_in_module.rb +19 -5
  80. data/test/fixtures/db_definitions/db2.drop.sql +3 -0
  81. data/test/fixtures/db_definitions/db2.sql +121 -100
  82. data/test/fixtures/db_definitions/db22.sql +2 -2
  83. data/test/fixtures/db_definitions/firebird.drop.sql +4 -0
  84. data/test/fixtures/db_definitions/firebird.sql +26 -0
  85. data/test/fixtures/db_definitions/mysql.drop.sql +3 -0
  86. data/test/fixtures/db_definitions/mysql.sql +21 -1
  87. data/test/fixtures/db_definitions/openbase.drop.sql +2 -0
  88. data/test/fixtures/db_definitions/openbase.sql +282 -0
  89. data/test/fixtures/db_definitions/openbase2.drop.sql +2 -0
  90. data/test/fixtures/db_definitions/openbase2.sql +7 -0
  91. data/test/fixtures/db_definitions/{oci.drop.sql → oracle.drop.sql} +6 -0
  92. data/test/fixtures/db_definitions/{oci.sql → oracle.sql} +25 -4
  93. data/test/fixtures/db_definitions/{oci2.drop.sql → oracle2.drop.sql} +0 -0
  94. data/test/fixtures/db_definitions/{oci2.sql → oracle2.sql} +0 -0
  95. data/test/fixtures/db_definitions/postgresql.drop.sql +4 -0
  96. data/test/fixtures/db_definitions/postgresql.sql +22 -1
  97. data/test/fixtures/db_definitions/schema.rb +32 -0
  98. data/test/fixtures/db_definitions/sqlite.drop.sql +3 -0
  99. data/test/fixtures/db_definitions/sqlite.sql +18 -0
  100. data/test/fixtures/db_definitions/sqlserver.drop.sql +3 -0
  101. data/test/fixtures/db_definitions/sqlserver.sql +23 -3
  102. data/test/fixtures/db_definitions/sybase.drop.sql +31 -0
  103. data/test/fixtures/db_definitions/sybase.sql +204 -0
  104. data/test/fixtures/db_definitions/sybase2.drop.sql +4 -0
  105. data/test/fixtures/db_definitions/sybase2.sql +5 -0
  106. data/test/fixtures/developers.yml +6 -1
  107. data/test/fixtures/developers_projects.yml +4 -0
  108. data/test/fixtures/funny_jokes.yml +14 -0
  109. data/test/fixtures/joke.rb +6 -0
  110. data/test/fixtures/legacy_thing.rb +3 -0
  111. data/test/fixtures/legacy_things.yml +3 -0
  112. data/test/fixtures/mixin.rb +1 -1
  113. data/test/fixtures/person.rb +4 -1
  114. data/test/fixtures/post.rb +26 -1
  115. data/test/fixtures/project.rb +1 -0
  116. data/test/fixtures/reader.rb +4 -0
  117. data/test/fixtures/readers.yml +4 -0
  118. data/test/fixtures/reply.rb +2 -1
  119. data/test/fixtures/tag.rb +5 -0
  120. data/test/fixtures/tagging.rb +6 -0
  121. data/test/fixtures/taggings.yml +18 -0
  122. data/test/fixtures/tags.yml +7 -0
  123. data/test/fixtures/tasks.yml +2 -2
  124. data/test/fixtures/topic.rb +2 -2
  125. data/test/fixtures/topics.yml +1 -0
  126. data/test/fixtures_test.rb +47 -13
  127. data/test/inheritance_test.rb +2 -2
  128. data/test/locking_test.rb +15 -1
  129. data/test/method_scoping_test.rb +248 -13
  130. data/test/migration_test.rb +68 -11
  131. data/test/mixin_nested_set_test.rb +1 -1
  132. data/test/modules_test.rb +6 -1
  133. data/test/readonly_test.rb +1 -1
  134. data/test/reflection_test.rb +63 -9
  135. data/test/schema_dumper_test.rb +41 -0
  136. data/test/{synonym_test_oci.rb → synonym_test_oracle.rb} +1 -1
  137. data/test/threaded_connections_test.rb +10 -0
  138. data/test/unconnected_test.rb +12 -5
  139. data/test/validations_test.rb +197 -10
  140. metadata +295 -260
  141. data/test/fixtures/db_definitions/create_oracle_db.bat +0 -0
  142. data/test/fixtures/db_definitions/create_oracle_db.sh +0 -0
  143. data/test/fixtures/fixture_database.sqlite +0 -0
  144. data/test/fixtures/fixture_database_2.sqlite +0 -0
@@ -1,5 +1,5 @@
1
1
  CREATE TABLE courses (
2
- id int NOT NULL PRIMARY KEY,
3
- name varchar(255) NOT NULL
2
+ id INT NOT NULL PRIMARY KEY,
3
+ name VARCHAR(255) NOT NULL
4
4
  );
5
5
 
@@ -1,4 +1,5 @@
1
1
  DROP TABLE accounts;
2
+ DROP TABLE funny_jokes;
2
3
  DROP TABLE companies;
3
4
  DROP TABLE topics;
4
5
  DROP TABLE developers;
@@ -14,6 +15,7 @@ DROP TABLE entrants;
14
15
  DROP TABLE colnametests;
15
16
  DROP TABLE mixins;
16
17
  DROP TABLE people;
18
+ DROP TABLE readers;
17
19
  DROP TABLE binaries;
18
20
  DROP TABLE computers;
19
21
  DROP TABLE posts;
@@ -26,10 +28,12 @@ DROP TABLE fk_test_has_fk;
26
28
  DROP TABLE fk_test_has_pk;
27
29
  DROP TABLE keyboards;
28
30
  DROP TABLE defaults;
31
+ DROP TABLE legacy_things;
29
32
 
30
33
  DROP DOMAIN D_BOOLEAN;
31
34
 
32
35
  DROP GENERATOR accounts_seq;
36
+ DROP GENERATOR funny_jokes_seq;
33
37
  DROP GENERATOR companies_nonstd_seq;
34
38
  DROP GENERATOR topics_seq;
35
39
  DROP GENERATOR developers_seq;
@@ -9,6 +9,14 @@ CREATE TABLE accounts (
9
9
  CREATE GENERATOR accounts_seq;
10
10
  SET GENERATOR accounts_seq TO 10000;
11
11
 
12
+ CREATE TABLE funny_jokes (
13
+ id BIGINT NOT NULL,
14
+ name VARCHAR(50),
15
+ PRIMARY KEY (id)
16
+ );
17
+ CREATE GENERATOR funny_jokes_seq;
18
+ SET GENERATOR funny_jokes_seq TO 10000;
19
+
12
20
  CREATE TABLE companies (
13
21
  id BIGINT NOT NULL,
14
22
  "TYPE" VARCHAR(50),
@@ -161,6 +169,15 @@ CREATE TABLE people (
161
169
  CREATE GENERATOR people_seq;
162
170
  SET GENERATOR people_seq TO 10000;
163
171
 
172
+ CREATE TABLE readers (
173
+ id BIGINT NOT NULL,
174
+ post_id BIGINT NOT NULL,
175
+ person_id BIGINT NOT NULL,
176
+ PRIMARY KEY (id)
177
+ );
178
+ CREATE GENERATOR readers_seq;
179
+ SET GENERATOR readers_seq TO 10000;
180
+
164
181
  CREATE TABLE binaries (
165
182
  id BIGINT NOT NULL,
166
183
  data BLOB,
@@ -257,3 +274,12 @@ CREATE TABLE defaults (
257
274
  );
258
275
  CREATE GENERATOR defaults_seq;
259
276
  SET GENERATOR defaults_seq TO 10000;
277
+
278
+ CREATE TABLE legacy_things (
279
+ id BIGINT NOT NULL,
280
+ tps_report_number INTEGER,
281
+ version INTEGER DEFAULT 0 NOT NULL,
282
+ PRIMARY KEY (id)
283
+ );
284
+ CREATE GENERATOR legacy_things_seq;
285
+ SET GENERATOR legacy_things_seq TO 10000;
@@ -1,4 +1,5 @@
1
1
  DROP TABLE accounts;
2
+ DROP TABLE funny_jokes;
2
3
  DROP TABLE companies;
3
4
  DROP TABLE topics;
4
5
  DROP TABLE developers;
@@ -14,6 +15,7 @@ DROP TABLE entrants;
14
15
  DROP TABLE colnametests;
15
16
  DROP TABLE mixins;
16
17
  DROP TABLE people;
18
+ DROP TABLE readers;
17
19
  DROP TABLE binaries;
18
20
  DROP TABLE computers;
19
21
  DROP TABLE tasks;
@@ -25,3 +27,4 @@ DROP TABLE categories_posts;
25
27
  DROP TABLE fk_test_has_fk;
26
28
  DROP TABLE fk_test_has_pk;
27
29
  DROP TABLE keyboards;
30
+ DROP TABLE legacy_things;
@@ -5,6 +5,12 @@ CREATE TABLE `accounts` (
5
5
  PRIMARY KEY (`id`)
6
6
  ) TYPE=InnoDB;
7
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
+
8
14
  CREATE TABLE `companies` (
9
15
  `id` int(11) NOT NULL auto_increment,
10
16
  `type` varchar(50) default NULL,
@@ -26,7 +32,7 @@ CREATE TABLE `topics` (
26
32
  `bonus_time` time default NULL,
27
33
  `last_read` date default NULL,
28
34
  `content` text,
29
- `approved` tinyint default 1,
35
+ `approved` tinyint(1) default 1,
30
36
  `replies_count` int(11) default 0,
31
37
  `parent_id` int(11) default NULL,
32
38
  `type` varchar(50) default NULL,
@@ -130,6 +136,12 @@ CREATE TABLE `people` (
130
136
  `lock_version` INTEGER NOT NULL DEFAULT 0
131
137
  ) TYPE=InnoDB;
132
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
+
133
145
  CREATE TABLE `binaries` (
134
146
  `id` int(11) NOT NULL auto_increment,
135
147
  `data` mediumblob,
@@ -197,3 +209,11 @@ CREATE TABLE `keyboards` (
197
209
  `key_number` int(11) NOT NULL auto_increment primary key,
198
210
  `name` varchar(50) default NULL
199
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;
@@ -0,0 +1,2 @@
1
+ DROP ALL
2
+ go
@@ -0,0 +1,282 @@
1
+ CREATE TABLE accounts (
2
+ id integer UNIQUE INDEX DEFAULT _rowid,
3
+ firm_id integer,
4
+ credit_limit integer
5
+ )
6
+ go
7
+ CREATE PRIMARY KEY accounts (id)
8
+ go
9
+
10
+ CREATE TABLE funny_jokes (
11
+ id integer UNIQUE INDEX DEFAULT _rowid,
12
+ name char(50) DEFAULT NULL
13
+ )
14
+ go
15
+ CREATE PRIMARY KEY funny_jokes (id)
16
+ go
17
+
18
+ CREATE TABLE companies (
19
+ id integer UNIQUE INDEX DEFAULT _rowid,
20
+ type char(50),
21
+ ruby_type char(50),
22
+ firm_id integer,
23
+ name char(50),
24
+ client_of integer,
25
+ rating integer default 1
26
+ )
27
+ go
28
+ CREATE PRIMARY KEY companies (id)
29
+ go
30
+
31
+ CREATE TABLE developers_projects (
32
+ developer_id integer NOT NULL,
33
+ project_id integer NOT NULL,
34
+ joined_on date,
35
+ access_level integer default 1
36
+ )
37
+ go
38
+
39
+ CREATE TABLE developers (
40
+ id integer UNIQUE INDEX DEFAULT _rowid,
41
+ name char(100),
42
+ salary integer DEFAULT 70000,
43
+ created_at datetime,
44
+ updated_at datetime
45
+ )
46
+ go
47
+ CREATE PRIMARY KEY developers (id)
48
+ go
49
+
50
+ CREATE TABLE projects (
51
+ id integer UNIQUE INDEX DEFAULT _rowid,
52
+ name char(100),
53
+ type char(255)
54
+ )
55
+ go
56
+ CREATE PRIMARY KEY projects (id)
57
+ go
58
+
59
+ CREATE TABLE topics (
60
+ id integer UNIQUE INDEX DEFAULT _rowid,
61
+ title char(255),
62
+ author_name char(255),
63
+ author_email_address char(255),
64
+ written_on datetime,
65
+ bonus_time time,
66
+ last_read date,
67
+ content char(4096),
68
+ approved boolean default true,
69
+ replies_count integer default 0,
70
+ parent_id integer,
71
+ type char(50)
72
+ )
73
+ go
74
+ CREATE PRIMARY KEY topics (id)
75
+ go
76
+
77
+ CREATE TABLE customers (
78
+ id integer UNIQUE INDEX DEFAULT _rowid,
79
+ name char,
80
+ balance integer default 0,
81
+ address_street char,
82
+ address_city char,
83
+ address_country char,
84
+ gps_location char
85
+ )
86
+ go
87
+ CREATE PRIMARY KEY customers (id)
88
+ go
89
+
90
+ CREATE TABLE orders (
91
+ id integer UNIQUE INDEX DEFAULT _rowid,
92
+ name char,
93
+ billing_customer_id integer,
94
+ shipping_customer_id integer
95
+ )
96
+ go
97
+ CREATE PRIMARY KEY orders (id)
98
+ go
99
+
100
+ CREATE TABLE movies (
101
+ movieid integer UNIQUE INDEX DEFAULT _rowid,
102
+ name text
103
+ )
104
+ go
105
+ CREATE PRIMARY KEY movies (movieid)
106
+ go
107
+
108
+ CREATE TABLE subscribers (
109
+ nick CHAR(100) NOT NULL DEFAULT _rowid,
110
+ name CHAR(100)
111
+ )
112
+ go
113
+ CREATE PRIMARY KEY subscribers (nick)
114
+ go
115
+
116
+ CREATE TABLE booleantests (
117
+ id integer UNIQUE INDEX DEFAULT _rowid,
118
+ value boolean
119
+ )
120
+ go
121
+ CREATE PRIMARY KEY booleantests (id)
122
+ go
123
+
124
+ CREATE TABLE defaults (
125
+ id integer UNIQUE INDEX ,
126
+ modified_date date default CURDATE(),
127
+ modified_date_function date default NOW(),
128
+ fixed_date date default '2004-01-01',
129
+ modified_time timestamp default NOW(),
130
+ modified_time_function timestamp default NOW(),
131
+ fixed_time timestamp default '2004-01-01 00:00:00.000000-00',
132
+ char1 char(1) default 'Y',
133
+ char2 char(50) default 'a char field',
134
+ char3 text default 'a text field'
135
+ )
136
+ go
137
+
138
+ CREATE TABLE auto_id_tests (
139
+ auto_id integer UNIQUE INDEX DEFAULT _rowid,
140
+ value integer
141
+ )
142
+ go
143
+ CREATE PRIMARY KEY auto_id_tests (auto_id)
144
+ go
145
+
146
+ CREATE TABLE entrants (
147
+ id integer UNIQUE INDEX ,
148
+ name text,
149
+ course_id integer
150
+ )
151
+ go
152
+
153
+ CREATE TABLE colnametests (
154
+ id integer UNIQUE INDEX ,
155
+ references integer NOT NULL
156
+ )
157
+ go
158
+
159
+ CREATE TABLE mixins (
160
+ id integer UNIQUE INDEX DEFAULT _rowid,
161
+ parent_id integer,
162
+ type char,
163
+ pos integer,
164
+ lft integer,
165
+ rgt integer,
166
+ root_id integer,
167
+ created_at timestamp,
168
+ updated_at timestamp
169
+ )
170
+ go
171
+ CREATE PRIMARY KEY mixins (id)
172
+ go
173
+
174
+ CREATE TABLE people (
175
+ id integer UNIQUE INDEX DEFAULT _rowid,
176
+ first_name text,
177
+ lock_version integer default 0
178
+ )
179
+ go
180
+ CREATE PRIMARY KEY people (id)
181
+ go
182
+
183
+ CREATE TABLE readers (
184
+ id integer UNIQUE INDEX DEFAULT _rowid,
185
+ post_id integer NOT NULL,
186
+ person_id integer NOT NULL
187
+ )
188
+ go
189
+ CREATE PRIMARY KEY readers (id)
190
+ go
191
+
192
+ CREATE TABLE binaries (
193
+ id integer UNIQUE INDEX DEFAULT _rowid,
194
+ data object
195
+ )
196
+ go
197
+ CREATE PRIMARY KEY binaries (id)
198
+ go
199
+
200
+ CREATE TABLE computers (
201
+ id integer UNIQUE INDEX ,
202
+ developer integer NOT NULL,
203
+ extendedWarranty integer NOT NULL
204
+ )
205
+ go
206
+
207
+ CREATE TABLE posts (
208
+ id integer UNIQUE INDEX ,
209
+ author_id integer,
210
+ title char(255),
211
+ type char(255),
212
+ body text
213
+ )
214
+ go
215
+
216
+ CREATE TABLE comments (
217
+ id integer UNIQUE INDEX ,
218
+ post_id integer,
219
+ type char(255),
220
+ body text
221
+ )
222
+ go
223
+
224
+ CREATE TABLE authors (
225
+ id integer UNIQUE INDEX ,
226
+ name char(255) default NULL
227
+ )
228
+ go
229
+
230
+ CREATE TABLE tasks (
231
+ id integer UNIQUE INDEX DEFAULT _rowid,
232
+ starting datetime,
233
+ ending datetime
234
+ )
235
+ go
236
+ CREATE PRIMARY KEY tasks (id)
237
+ go
238
+
239
+ CREATE TABLE categories (
240
+ id integer UNIQUE INDEX ,
241
+ name char(255),
242
+ type char(255)
243
+ )
244
+ go
245
+
246
+ CREATE TABLE categories_posts (
247
+ category_id integer NOT NULL,
248
+ post_id integer NOT NULL
249
+ )
250
+ go
251
+
252
+ CREATE TABLE fk_test_has_pk (
253
+ id INTEGER NOT NULL DEFAULT _rowid
254
+ )
255
+ go
256
+ CREATE PRIMARY KEY fk_test_has_pk (id)
257
+ go
258
+
259
+ CREATE TABLE fk_test_has_fk (
260
+ id INTEGER NOT NULL DEFAULT _rowid,
261
+ fk_id INTEGER NOT NULL REFERENCES fk_test_has_pk.id
262
+ )
263
+ go
264
+ CREATE PRIMARY KEY fk_test_has_fk (id)
265
+ go
266
+
267
+ CREATE TABLE keyboards (
268
+ key_number integer UNIQUE INDEX DEFAULT _rowid,
269
+ name char(50)
270
+ )
271
+ go
272
+ CREATE PRIMARY KEY keyboards (key_number)
273
+ go
274
+
275
+ CREATE TABLE legacy_things (
276
+ id INTEGER NOT NULL DEFAULT _rowid,
277
+ tps_report_number INTEGER default NULL,
278
+ version integer NOT NULL default 0
279
+ )
280
+ go
281
+ CREATE PRIMARY KEY legacy_things (id)
282
+ go
@@ -0,0 +1,2 @@
1
+ DROP TABLE courses
2
+ go
@@ -0,0 +1,7 @@
1
+ CREATE TABLE courses (
2
+ id integer UNIQUE INDEX DEFAULT _rowid,
3
+ name text
4
+ )
5
+ go
6
+ CREATE PRIMARY KEY courses (id)
7
+ go
@@ -1,4 +1,5 @@
1
1
  drop table accounts;
2
+ drop table funny_jokes;
2
3
  drop table companies;
3
4
  drop table topics;
4
5
  drop synonym subjects;
@@ -16,6 +17,7 @@ drop table entrants;
16
17
  drop table colnametests;
17
18
  drop table mixins;
18
19
  drop table people;
20
+ drop table readers;
19
21
  drop table binaries;
20
22
  drop table comments;
21
23
  drop table authors;
@@ -26,7 +28,10 @@ drop table posts;
26
28
  drop table fk_test_has_pk;
27
29
  drop table fk_test_has_fk;
28
30
  drop table keyboards;
31
+ drop table legacy_things;
32
+
29
33
  drop sequence accounts_seq;
34
+ drop sequence funny_jokes_seq;
30
35
  drop sequence companies_nonstd_seq;
31
36
  drop sequence topics_seq;
32
37
  drop sequence developers_seq;
@@ -53,3 +58,4 @@ drop sequence categories_posts_seq;
53
58
  drop sequence fk_test_has_pk_seq;
54
59
  drop sequence fk_test_has_fk_seq;
55
60
  drop sequence keyboards_seq;
61
+ drop sequence legacy_things_seq;