ibm_db 1.0.2 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,451 +1,484 @@
1
-
2
- ActiveRecord::Schema.define do
3
- def except(adapter_names_to_exclude)
4
- unless [adapter_names_to_exclude].flatten.include?(adapter_name)
5
- yield
6
- end
7
- end
8
-
9
- #put adapter specific setup here
10
- case adapter_name
11
- # For Firebird, set the sequence values 10000 when create_table is called;
12
- # this prevents primary key collisions between "normally" created records
13
- # and fixture-based (YAML) records.
14
- when "Firebird"
15
- def create_table(*args, &block)
16
- ActiveRecord::Base.connection.create_table(*args, &block)
17
- ActiveRecord::Base.connection.execute "SET GENERATOR #{args.first}_seq TO 10000"
18
- end
19
- end
20
-
21
-
22
- # Please keep these create table statements in alphabetical order
23
- # unless the ordering matters. In which case, define them below
24
- create_table :accounts, :force => true do |t|
25
- t.integer :firm_id
26
- t.integer :credit_limit
27
- end
28
-
29
- create_table :audit_logs, :force => true do |t|
30
- t.column :message, :string, :null=>false
31
- t.column :developer_id, :integer, :null=>false
32
- end
33
-
34
- create_table :authors, :force => true do |t|
35
- t.string :name, :null => false
36
- t.integer :author_address_id
37
- t.integer :author_address_extra_id
38
- end
39
-
40
- create_table :author_addresses, :force => true do |t|
41
- end
42
-
43
- create_table :author_favorites, :force => true do |t|
44
- t.column :author_id, :integer
45
- t.column :favorite_author_id, :integer
46
- end
47
-
48
-
49
- create_table :auto_id_tests, :force => true, :id => false do |t|
50
- t.primary_key :auto_id
51
- t.integer :value
52
- end
53
-
54
- create_table :binaries, :force => true do |t|
55
- t.binary :data
56
- end
57
-
58
- create_table :books, :force => true do |t|
59
- t.column :name, :string
60
- end
61
-
62
- create_table :booleantests, :force => true do |t|
63
- t.boolean :value
64
- end
65
-
66
- create_table :categories, :force => true do |t|
67
- t.string :name, :null => false
68
- t.string :type
69
- t.integer :categorizations_count
70
- end
71
-
72
- create_table :categories_posts, :force => true, :id => false do |t|
73
- t.integer :category_id, :null => false
74
- t.integer :post_id, :null => false
75
- end
76
-
77
- create_table :categorizations, :force => true do |t|
78
- t.column :category_id, :integer
79
- t.column :post_id, :integer
80
- t.column :author_id, :integer
81
- end
82
-
83
- create_table :citations, :force => true do |t|
84
- t.column :book1_id, :integer
85
- t.column :book2_id, :integer
86
- end
87
-
88
- create_table :clubs, :force => true do |t|
89
- t.string :name
90
- end
91
-
92
- create_table :colnametests, :force => true do |t|
93
- t.integer :references, :null => false
94
- end
95
-
96
- except 'IBM_DB' do
97
- create_table :comments, :force => true do |t|
98
- t.integer :post_id, :null => false
99
- t.text :body, :null => false
100
- t.string :type
101
- end
102
- end
103
-
104
- create_table :companies, :force => true do |t|
105
- t.string :type
106
- t.string :ruby_type
107
- t.integer :firm_id
108
- t.string :firm_name
109
- t.string :name
110
- t.integer :client_of
111
- t.integer :rating, :default => 1
112
- end
113
-
114
- create_table :computers, :force => true do |t|
115
- t.integer :developer, :null => false
116
- t.integer :extendedWarranty, :null => false
117
- end
118
-
119
-
120
- create_table :customers, :force => true do |t|
121
- t.string :name
122
- t.integer :balance, :default => 0
123
- t.string :address_street
124
- t.string :address_city
125
- t.string :address_country
126
- t.string :gps_location
127
- end
128
-
129
- create_table :developers, :force => true do |t|
130
- t.string :name
131
- t.integer :salary, :default => 70000
132
- t.timestamp :created_at
133
- t.datetime :updated_at
134
- end
135
-
136
- create_table :developers_projects, :force => true, :id => false do |t|
137
- t.integer :developer_id, :null => false
138
- t.integer :project_id, :null => false
139
- t.date :joined_on
140
- t.integer :access_level, :default => 1
141
- end
142
-
143
- create_table :edges, :force => true do |t|
144
- t.column :source_id, :integer, :null => false
145
- t.column :sink_id, :integer, :null => false
146
- end
147
- add_index :edges, [:source_id, :sink_id], :unique => true, :name => 'unique_edge_index'
148
-
149
-
150
- create_table :entrants, :force => true do |t|
151
- t.string :name, :null => false
152
- t.integer :course_id, :null => false
153
- end
154
-
155
- create_table :funny_jokes, :force => true do |t|
156
- t.string :name
157
- end
158
-
159
- except 'IBM_DB' do
160
- create_table :items, :force => true do |t|
161
- t.column :name, :string
162
- end
163
- end
164
-
165
- create_table :inept_wizards, :force => true do |t|
166
- t.column :name, :string, :null => false
167
- t.column :city, :string, :null => false
168
- t.column :type, :string
169
- end
170
-
171
-
172
- create_table :jobs, :force => true do |t|
173
- t.integer :ideal_reference_id
174
- end
175
-
176
- create_table :keyboards, :force => true, :id => false do |t|
177
- t.primary_key :key_number
178
- t.string :name
179
- end
180
-
181
- create_table :legacy_things, :force => true do |t|
182
- t.integer :tps_report_number
183
- t.integer :version, :null => false, :default => 0
184
- end
185
-
186
- create_table :lock_without_defaults, :force => true do |t|
187
- t.column :lock_version, :integer
188
- end
189
-
190
- create_table :lock_without_defaults_cust, :force => true do |t|
191
- t.column :custom_lock_version, :integer
192
- end
193
-
194
- create_table :mateys, :id => false, :force => true do |t|
195
- t.column :pirate_id, :integer
196
- t.column :target_id, :integer
197
- t.column :weight, :integer
198
- end
199
-
200
- create_table :members, :force => true do |t|
201
- t.string :name
202
- end
203
-
204
- create_table :member_details, :force => true do |t|
205
- t.integer :member_id
206
- t.integer :organization_id
207
- t.string :extra_data
208
- end
209
-
210
- create_table :memberships, :force => true do |t|
211
- t.datetime :joined_on
212
- t.integer :club_id, :member_id
213
- t.boolean :favourite, :default => false
214
- t.string :type
215
- end
216
-
217
- create_table :references, :force => true do |t|
218
- t.integer :person_id
219
- t.integer :job_id
220
- t.boolean :favourite
221
- t.integer :lock_version, :default => 0
222
- end
223
-
224
- create_table :minimalistics, :force => true do |t|
225
- end
226
-
227
- create_table :mixed_case_monkeys, :force => true, :id => false do |t|
228
- t.primary_key :monkeyID
229
- t.integer :fleaCount
230
- end
231
-
232
- create_table :mixins, :force => true do |t|
233
- t.integer :parent_id
234
- t.integer :pos
235
- t.datetime :created_at
236
- t.datetime :updated_at
237
- t.integer :lft
238
- t.integer :rgt
239
- t.integer :root_id
240
- t.string :type
241
- end
242
-
243
- create_table :movies, :force => true, :id => false do |t|
244
- t.primary_key :movieid
245
- t.string :name
246
- end
247
-
248
- create_table :numeric_data, :force => true do |t|
249
- t.decimal :bank_balance, :precision => 10, :scale => 2
250
- t.decimal :big_bank_balance, :precision => 15, :scale => 2
251
- t.decimal :world_population, :precision => 10, :scale => 0
252
- t.decimal :my_house_population, :precision => 2, :scale => 0
253
- t.decimal :decimal_number_with_default, :precision => 3, :scale => 2, :default => 2.78
254
- end
255
-
256
- create_table :orders, :force => true do |t|
257
- t.string :name
258
- t.integer :billing_customer_id
259
- t.integer :shipping_customer_id
260
- end
261
-
262
- create_table :organizations, :force => true do |t|
263
- t.string :name
264
- end
265
-
266
- create_table :owners, :primary_key => :owner_id ,:force => true do |t|
267
- t.string :name
268
- end
269
-
270
- except 'IBM_DB' do
271
- create_table :paint_colors, :force => true do |t|
272
- t.integer :non_poly_one_id
273
- end
274
-
275
- create_table :paint_textures, :force => true do |t|
276
- t.integer :non_poly_two_id
277
- end
278
- end
279
-
280
- create_table :parrots, :force => true do |t|
281
- t.column :name, :string
282
- t.column :parrot_sti_class, :string
283
- t.column :killer_id, :integer
284
- t.column :created_at, :datetime
285
- t.column :created_on, :datetime
286
- t.column :updated_at, :datetime
287
- t.column :updated_on, :datetime
288
- end
289
-
290
- create_table :parrots_pirates, :id => false, :force => true do |t|
291
- t.column :parrot_id, :integer
292
- t.column :pirate_id, :integer
293
- end
294
-
295
- create_table :parrots_treasures, :id => false, :force => true do |t|
296
- t.column :parrot_id, :integer
297
- t.column :treasure_id, :integer
298
- end
299
-
300
- create_table :people, :force => true do |t|
301
- t.string :first_name, :null => false
302
- t.integer :lock_version, :null => false, :default => 0
303
- end
304
-
305
- create_table :pets, :primary_key => :pet_id ,:force => true do |t|
306
- t.string :name
307
- t.integer :owner_id, :integer
308
- end
309
-
310
- create_table :pirates, :force => true do |t|
311
- t.column :catchphrase, :string
312
- t.column :parrot_id, :integer
313
- t.column :created_on, :datetime
314
- t.column :updated_on, :datetime
315
- end
316
-
317
- except 'IBM_DB' do
318
- create_table :posts, :force => true do |t|
319
- t.integer :author_id
320
- t.string :title, :null => false
321
- t.text :body, :null => false
322
- t.string :type
323
- t.integer :comments_count, :default => 0
324
- t.integer :taggings_count, :default => 0
325
- end
326
- end
327
-
328
- create_table :price_estimates, :force => true do |t|
329
- t.string :estimate_of_type
330
- t.integer :estimate_of_id
331
- t.integer :price
332
- end
333
-
334
- create_table :projects, :force => true do |t|
335
- t.string :name
336
- t.string :type
337
- end
338
-
339
- create_table :readers, :force => true do |t|
340
- t.integer :post_id, :null => false
341
- t.integer :person_id, :null => false
342
- end
343
-
344
- create_table :shape_expressions, :force => true do |t|
345
- t.string :paint_type
346
- t.integer :paint_id
347
- t.string :shape_type
348
- t.integer :shape_id
349
- end
350
-
351
- create_table :ships, :force => true do |t|
352
- t.string :name
353
- t.datetime :created_at
354
- t.datetime :created_on
355
- t.datetime :updated_at
356
- t.datetime :updated_on
357
- end
358
-
359
- create_table :sponsors, :force => true do |t|
360
- t.integer :club_id
361
- t.integer :sponsorable_id
362
- t.string :sponsorable_type
363
- end
364
-
365
- create_table :subscribers, :force => true, :id => false do |t|
366
- t.string :nick, :null => false
367
- t.string :name
368
- end
369
- add_index :subscribers, :nick, :unique => true
370
-
371
- create_table :subscriptions, :force => true do |t|
372
- t.string :subscriber_id
373
- t.integer :book_id
374
- end
375
-
376
- create_table :tasks, :force => true do |t|
377
- t.datetime :starting
378
- t.datetime :ending
379
- end
380
-
381
- except 'IBM_DB' do
382
- create_table :topics, :force => true do |t|
383
- t.string :title
384
- t.string :author_name
385
- t.string :author_email_address
386
- t.datetime :written_on
387
- t.time :bonus_time
388
- t.date :last_read
389
- t.text :content
390
- t.boolean :approved, :default => true
391
- t.integer :replies_count, :default => 0
392
- t.integer :parent_id
393
- t.string :type
394
- end
395
- end
396
-
397
- create_table :taggings, :force => true do |t|
398
- t.column :tag_id, :integer
399
- t.column :super_tag_id, :integer
400
- t.column :taggable_type, :string
401
- t.column :taggable_id, :integer
402
- end
403
-
404
- create_table :tags, :force => true do |t|
405
- t.column :name, :string
406
- t.column :taggings_count, :integer, :default => 0
407
- end
408
-
409
- create_table :treasures, :force => true do |t|
410
- t.column :name, :string
411
- t.column :looter_id, :integer
412
- t.column :looter_type, :string
413
- end
414
-
415
- create_table :vertices, :force => true do |t|
416
- t.column :label, :string
417
- end
418
-
419
- create_table 'warehouse_things', :force => true do |t|
420
- t.integer :value
421
- end
422
-
423
- except 'IBM_DB' do
424
- [:circles, :squares, :triangles, :non_poly_ones, :non_poly_twos].each do |t|
425
- create_table(t, :force => true) { }
426
- end
427
- end
428
-
429
- create_table :guids, :force => true do |t|
430
- t.column :key, :string
431
- end
432
-
433
- create_table :integer_limits, :force => true do |t|
434
- t.integer :"c_int_without_limit"
435
- (1..8).each do |i|
436
- t.integer :"c_int_#{i}", :limit => i
437
- end
438
- end
439
-
440
- except ['SQLite','IBM_DB'] do
441
- # fk_test_has_fk should be before fk_test_has_pk
442
- create_table :fk_test_has_fk, :force => true do |t|
443
- t.integer :fk_id, :null => false
444
- end
445
-
446
- create_table :fk_test_has_pk, :force => true do |t|
447
- end
448
-
449
- execute "ALTER TABLE fk_test_has_fk ADD CONSTRAINT fk_name FOREIGN KEY (#{quote_column_name 'fk_id'}) REFERENCES #{quote_table_name 'fk_test_has_pk'} (#{quote_column_name 'id'})"
450
- end
451
- end
1
+
2
+ ActiveRecord::Schema.define do
3
+ def except(adapter_names_to_exclude)
4
+ unless [adapter_names_to_exclude].flatten.include?(adapter_name)
5
+ yield
6
+ end
7
+ end
8
+
9
+ #put adapter specific setup here
10
+ case adapter_name
11
+ # For Firebird, set the sequence values 10000 when create_table is called;
12
+ # this prevents primary key collisions between "normally" created records
13
+ # and fixture-based (YAML) records.
14
+ when "Firebird"
15
+ def create_table(*args, &block)
16
+ ActiveRecord::Base.connection.create_table(*args, &block)
17
+ ActiveRecord::Base.connection.execute "SET GENERATOR #{args.first}_seq TO 10000"
18
+ end
19
+ end
20
+
21
+
22
+ # Please keep these create table statements in alphabetical order
23
+ # unless the ordering matters. In which case, define them below
24
+ create_table :accounts, :force => true do |t|
25
+ t.integer :firm_id
26
+ t.integer :credit_limit
27
+ end
28
+
29
+ create_table :audit_logs, :force => true do |t|
30
+ t.column :message, :string, :null=>false
31
+ t.column :developer_id, :integer, :null=>false
32
+ end
33
+
34
+ create_table :authors, :force => true do |t|
35
+ t.string :name, :null => false
36
+ t.integer :author_address_id
37
+ t.integer :author_address_extra_id
38
+ end
39
+
40
+ create_table :author_addresses, :force => true do |t|
41
+ end
42
+
43
+ create_table :author_favorites, :force => true do |t|
44
+ t.column :author_id, :integer
45
+ t.column :favorite_author_id, :integer
46
+ end
47
+
48
+
49
+ create_table :auto_id_tests, :force => true, :id => false do |t|
50
+ t.primary_key :auto_id
51
+ t.integer :value
52
+ end
53
+
54
+ create_table :binaries, :force => true do |t|
55
+ t.binary :data
56
+ end
57
+
58
+ create_table :birds, :force => true do |t|
59
+ t.string :name
60
+ t.integer :pirate_id
61
+ end
62
+
63
+ create_table :books, :force => true do |t|
64
+ t.column :name, :string
65
+ end
66
+
67
+ create_table :booleantests, :force => true do |t|
68
+ t.boolean :value
69
+ end
70
+
71
+ create_table :categories, :force => true do |t|
72
+ t.string :name, :null => false
73
+ t.string :type
74
+ t.integer :categorizations_count
75
+ end
76
+
77
+ create_table :categories_posts, :force => true, :id => false do |t|
78
+ t.integer :category_id, :null => false
79
+ t.integer :post_id, :null => false
80
+ end
81
+
82
+ create_table :categorizations, :force => true do |t|
83
+ t.column :category_id, :integer
84
+ t.column :post_id, :integer
85
+ t.column :author_id, :integer
86
+ end
87
+
88
+ create_table :citations, :force => true do |t|
89
+ t.column :book1_id, :integer
90
+ t.column :book2_id, :integer
91
+ end
92
+
93
+ create_table :clubs, :force => true do |t|
94
+ t.string :name
95
+ end
96
+
97
+ create_table :colnametests, :force => true do |t|
98
+ t.integer :references, :null => false
99
+ end
100
+
101
+ except 'IBM_DB' do
102
+ create_table :comments, :force => true do |t|
103
+ t.integer :post_id, :null => false
104
+ t.text :body, :null => false
105
+ t.string :type
106
+ end
107
+ end
108
+
109
+ create_table :companies, :force => true do |t|
110
+ t.string :type
111
+ t.string :ruby_type
112
+ t.integer :firm_id
113
+ t.string :firm_name
114
+ t.string :name
115
+ t.integer :client_of
116
+ t.integer :rating, :default => 1
117
+ end
118
+
119
+ create_table :computers, :force => true do |t|
120
+ t.integer :developer, :null => false
121
+ t.integer :extendedWarranty, :null => false
122
+ end
123
+
124
+
125
+ create_table :customers, :force => true do |t|
126
+ t.string :name
127
+ t.integer :balance, :default => 0
128
+ t.string :address_street
129
+ t.string :address_city
130
+ t.string :address_country
131
+ t.string :gps_location
132
+ end
133
+
134
+ create_table :developers, :force => true do |t|
135
+ t.string :name
136
+ t.integer :salary, :default => 70000
137
+ t.datetime :created_at
138
+ t.datetime :updated_at
139
+ end
140
+
141
+ create_table :developers_projects, :force => true, :id => false do |t|
142
+ t.integer :developer_id, :null => false
143
+ t.integer :project_id, :null => false
144
+ t.date :joined_on
145
+ t.integer :access_level, :default => 1
146
+ end
147
+
148
+ create_table :edges, :force => true do |t|
149
+ t.column :source_id, :integer, :null => false
150
+ t.column :sink_id, :integer, :null => false
151
+ end
152
+ add_index :edges, [:source_id, :sink_id], :unique => true, :name => 'unique_edge_index'
153
+
154
+
155
+ create_table :entrants, :force => true do |t|
156
+ t.string :name, :null => false
157
+ t.integer :course_id, :null => false
158
+ end
159
+
160
+ create_table :events, :force => true do |t|
161
+ t.string :title, :limit => 5
162
+ end
163
+
164
+ create_table :funny_jokes, :force => true do |t|
165
+ t.string :name
166
+ end
167
+
168
+ create_table :goofy_string_id, :force => true, :id => false do |t|
169
+ t.string :id, :null => false
170
+ t.string :info
171
+ end
172
+
173
+ except 'IBM_DB' do
174
+ create_table :items, :force => true do |t|
175
+ t.column :name, :string
176
+ end
177
+ end
178
+
179
+ create_table :inept_wizards, :force => true do |t|
180
+ t.column :name, :string, :null => false
181
+ t.column :city, :string, :null => false
182
+ t.column :type, :string
183
+ end
184
+
185
+
186
+ create_table :jobs, :force => true do |t|
187
+ t.integer :ideal_reference_id
188
+ end
189
+
190
+ create_table :keyboards, :force => true, :id => false do |t|
191
+ t.primary_key :key_number
192
+ t.string :name
193
+ end
194
+
195
+ create_table :legacy_things, :force => true do |t|
196
+ t.integer :tps_report_number
197
+ t.integer :version, :null => false, :default => 0
198
+ end
199
+
200
+ create_table :lock_without_defaults, :force => true do |t|
201
+ t.column :lock_version, :integer
202
+ end
203
+
204
+ create_table :lock_without_defaults_cust, :force => true do |t|
205
+ t.column :custom_lock_version, :integer
206
+ end
207
+
208
+ create_table :mateys, :id => false, :force => true do |t|
209
+ t.column :pirate_id, :integer
210
+ t.column :target_id, :integer
211
+ t.column :weight, :integer
212
+ end
213
+
214
+ create_table :members, :force => true do |t|
215
+ t.string :name
216
+ t.integer :member_type_id
217
+ end
218
+
219
+ create_table :member_details, :force => true do |t|
220
+ t.integer :member_id
221
+ t.integer :organization_id
222
+ t.string :extra_data
223
+ end
224
+
225
+ create_table :memberships, :force => true do |t|
226
+ t.datetime :joined_on
227
+ t.integer :club_id, :member_id
228
+ t.boolean :favourite, :default => false
229
+ t.string :type
230
+ end
231
+
232
+ create_table :member_types, :force => true do |t|
233
+ t.string :name
234
+ end
235
+
236
+ create_table :references, :force => true do |t|
237
+ t.integer :person_id
238
+ t.integer :job_id
239
+ t.boolean :favourite
240
+ t.integer :lock_version, :default => 0
241
+ end
242
+
243
+ create_table :minimalistics, :force => true do |t|
244
+ end
245
+
246
+ create_table :mixed_case_monkeys, :force => true, :id => false do |t|
247
+ t.primary_key :monkeyID
248
+ t.integer :fleaCount
249
+ end
250
+
251
+ create_table :mixins, :force => true do |t|
252
+ t.integer :parent_id
253
+ t.integer :pos
254
+ t.datetime :created_at
255
+ t.datetime :updated_at
256
+ t.integer :lft
257
+ t.integer :rgt
258
+ t.integer :root_id
259
+ t.string :type
260
+ end
261
+
262
+ create_table :movies, :force => true, :id => false do |t|
263
+ t.primary_key :movieid
264
+ t.string :name
265
+ end
266
+
267
+ create_table :numeric_data, :force => true do |t|
268
+ t.decimal :bank_balance, :precision => 10, :scale => 2
269
+ t.decimal :big_bank_balance, :precision => 15, :scale => 2
270
+ t.decimal :world_population, :precision => 10, :scale => 0
271
+ t.decimal :my_house_population, :precision => 2, :scale => 0
272
+ t.decimal :decimal_number_with_default, :precision => 3, :scale => 2, :default => 2.78
273
+ t.float :temperature
274
+ end
275
+
276
+ create_table :orders, :force => true do |t|
277
+ t.string :name
278
+ t.integer :billing_customer_id
279
+ t.integer :shipping_customer_id
280
+ end
281
+
282
+ create_table :organizations, :force => true do |t|
283
+ t.string :name
284
+ end
285
+
286
+ create_table :owners, :primary_key => :owner_id ,:force => true do |t|
287
+ t.string :name
288
+ end
289
+
290
+ except 'IBM_DB' do
291
+ create_table :paint_colors, :force => true do |t|
292
+ t.integer :non_poly_one_id
293
+ end
294
+
295
+ create_table :paint_textures, :force => true do |t|
296
+ t.integer :non_poly_two_id
297
+ end
298
+ end
299
+
300
+ create_table :parrots, :force => true do |t|
301
+ t.column :name, :string
302
+ t.column :parrot_sti_class, :string
303
+ t.column :killer_id, :integer
304
+ t.column :created_at, :datetime
305
+ t.column :created_on, :datetime
306
+ t.column :updated_at, :datetime
307
+ t.column :updated_on, :datetime
308
+ end
309
+
310
+ create_table :parrots_pirates, :id => false, :force => true do |t|
311
+ t.column :parrot_id, :integer
312
+ t.column :pirate_id, :integer
313
+ end
314
+
315
+ create_table :parrots_treasures, :id => false, :force => true do |t|
316
+ t.column :parrot_id, :integer
317
+ t.column :treasure_id, :integer
318
+ end
319
+
320
+ create_table :people, :force => true do |t|
321
+ t.string :first_name, :null => false
322
+ t.references :primary_contact
323
+ t.string :gender, :limit => 1
324
+ t.integer :lock_version, :null => false, :default => 0
325
+ end
326
+
327
+ create_table :pets, :primary_key => :pet_id ,:force => true do |t|
328
+ t.string :name
329
+ t.integer :owner_id, :integer
330
+ end
331
+
332
+ create_table :pirates, :force => true do |t|
333
+ t.column :catchphrase, :string
334
+ t.column :parrot_id, :integer
335
+ t.column :created_on, :datetime
336
+ t.column :updated_on, :datetime
337
+ end
338
+
339
+ except 'IBM_DB' do
340
+ create_table :posts, :force => true do |t|
341
+ t.integer :author_id
342
+ t.string :title, :null => false
343
+ t.text :body, :null => false
344
+ t.string :type
345
+ t.integer :comments_count, :default => 0
346
+ t.integer :taggings_count, :default => 0
347
+ end
348
+ end
349
+
350
+ create_table :price_estimates, :force => true do |t|
351
+ t.string :estimate_of_type
352
+ t.integer :estimate_of_id
353
+ t.integer :price
354
+ end
355
+
356
+ create_table :projects, :force => true do |t|
357
+ t.string :name
358
+ t.string :type
359
+ end
360
+
361
+ create_table :readers, :force => true do |t|
362
+ t.integer :post_id, :null => false
363
+ t.integer :person_id, :null => false
364
+ end
365
+
366
+ create_table :shape_expressions, :force => true do |t|
367
+ t.string :paint_type
368
+ t.integer :paint_id
369
+ t.string :shape_type
370
+ t.integer :shape_id
371
+ end
372
+
373
+ create_table :ships, :force => true do |t|
374
+ t.string :name
375
+ t.integer :pirate_id
376
+ t.datetime :created_at
377
+ t.datetime :created_on
378
+ t.datetime :updated_at
379
+ t.datetime :updated_on
380
+ end
381
+
382
+ create_table :ship_parts, :force => true do |t|
383
+ t.string :name
384
+ t.integer :ship_id
385
+ end
386
+
387
+ create_table :sponsors, :force => true do |t|
388
+ t.integer :club_id
389
+ t.integer :sponsorable_id
390
+ t.string :sponsorable_type
391
+ end
392
+
393
+ create_table :subscribers, :force => true, :id => false do |t|
394
+ t.string :nick, :null => false
395
+ t.string :name
396
+ end
397
+ add_index :subscribers, :nick, :unique => true
398
+
399
+ create_table :subscriptions, :force => true do |t|
400
+ t.string :subscriber_id
401
+ t.integer :book_id
402
+ end
403
+
404
+ create_table :tasks, :force => true do |t|
405
+ t.datetime :starting
406
+ t.datetime :ending
407
+ end
408
+
409
+ except 'IBM_DB' do
410
+ create_table :topics, :force => true do |t|
411
+ t.string :title
412
+ t.string :author_name
413
+ t.string :author_email_address
414
+ t.datetime :written_on
415
+ t.time :bonus_time
416
+ t.date :last_read
417
+ t.text :content
418
+ t.boolean :approved, :default => true
419
+ t.integer :replies_count, :default => 0
420
+ t.integer :parent_id
421
+ t.string :type
422
+ end
423
+ end
424
+
425
+ create_table :taggings, :force => true do |t|
426
+ t.column :tag_id, :integer
427
+ t.column :super_tag_id, :integer
428
+ t.column :taggable_type, :string
429
+ t.column :taggable_id, :integer
430
+ end
431
+
432
+ create_table :tags, :force => true do |t|
433
+ t.column :name, :string
434
+ t.column :taggings_count, :integer, :default => 0
435
+ end
436
+
437
+ create_table :toys, :primary_key => :toy_id ,:force => true do |t|
438
+ t.string :name
439
+ t.integer :pet_id, :integer
440
+ end
441
+
442
+ create_table :treasures, :force => true do |t|
443
+ t.column :name, :string
444
+ t.column :looter_id, :integer
445
+ t.column :looter_type, :string
446
+ end
447
+
448
+ create_table :vertices, :force => true do |t|
449
+ t.column :label, :string
450
+ end
451
+
452
+ create_table 'warehouse_things', :force => true do |t|
453
+ t.integer :value
454
+ end
455
+
456
+ except 'IBM_DB' do
457
+ [:circles, :squares, :triangles, :non_poly_ones, :non_poly_twos].each do |t|
458
+ create_table(t, :force => true) { }
459
+ end
460
+ end
461
+
462
+ create_table :guids, :force => true do |t|
463
+ t.column :key, :string
464
+ end
465
+
466
+ create_table :integer_limits, :force => true do |t|
467
+ t.integer :"c_int_without_limit"
468
+ (1..8).each do |i|
469
+ t.integer :"c_int_#{i}", :limit => i
470
+ end
471
+ end
472
+
473
+ except ['SQLite','IBM_DB'] do
474
+ # fk_test_has_fk should be before fk_test_has_pk
475
+ create_table :fk_test_has_fk, :force => true do |t|
476
+ t.integer :fk_id, :null => false
477
+ end
478
+
479
+ create_table :fk_test_has_pk, :force => true do |t|
480
+ end
481
+
482
+ execute "ALTER TABLE fk_test_has_fk ADD CONSTRAINT fk_name FOREIGN KEY (#{quote_column_name 'fk_id'}) REFERENCES #{quote_table_name 'fk_test_has_pk'} (#{quote_column_name 'id'})"
483
+ end
484
+ end