activerecord-jdbcteradata-adapter 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +4 -3
- data/README.md +3 -0
- data/activerecord-jdbcteradata-adapter.gemspec +1 -1
- data/lib/arel/visitors/teradata.rb +2 -3
- data/lib/arjdbc/teradata/adapter.rb +147 -7
- data/spec/active_record_schema_spec.rb +38 -0
- data/spec/adapter_spec.rb +4 -0
- data/spec/associations_spec.rb +34 -0
- data/spec/models/active_record_models.rb +3 -0
- data/spec/models/active_record_schema.rb +732 -0
- data/spec/models/purchase_orders.rb +59 -0
- metadata +70 -72
@@ -0,0 +1,732 @@
|
|
1
|
+
class CreateActiveRecordSchema < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
|
5
|
+
# ------------------------------------------------------------------- #
|
6
|
+
# #
|
7
|
+
# Please keep these create table statements in alphabetical order #
|
8
|
+
# unless the ordering matters. In which case, define them below. #
|
9
|
+
# #
|
10
|
+
# ------------------------------------------------------------------- #
|
11
|
+
|
12
|
+
create_table :ar_accounts, :force => true do |t|
|
13
|
+
t.integer :firm_id
|
14
|
+
t.string :firm_name
|
15
|
+
t.integer :credit_limit
|
16
|
+
end
|
17
|
+
|
18
|
+
create_table :ar_admin_accounts, :force => true do |t|
|
19
|
+
t.string :name
|
20
|
+
end
|
21
|
+
|
22
|
+
create_table :ar_admin_users, :force => true do |t|
|
23
|
+
t.string :name
|
24
|
+
t.string :settings, :null => true, :limit => 1024
|
25
|
+
# MySQL does not allow default values for blobs. Fake it out with a
|
26
|
+
# big varchar below.
|
27
|
+
t.string :preferences, :null => true, :default => '', :limit => 1024
|
28
|
+
t.references :account
|
29
|
+
end
|
30
|
+
|
31
|
+
create_table :ar_aircraft, :force => true do |t|
|
32
|
+
t.string :name
|
33
|
+
end
|
34
|
+
|
35
|
+
create_table :ar_audit_logs, :force => true do |t|
|
36
|
+
t.column :message, :string, :null=>false
|
37
|
+
t.column :developer_id, :integer, :null=>false
|
38
|
+
t.integer :unvalidated_developer_id
|
39
|
+
end
|
40
|
+
|
41
|
+
create_table :ar_authors, :force => true do |t|
|
42
|
+
t.string :name, :null => false
|
43
|
+
t.integer :author_address_id
|
44
|
+
t.integer :author_address_extra_id
|
45
|
+
t.string :organization_id
|
46
|
+
t.string :owned_essay_id
|
47
|
+
end
|
48
|
+
|
49
|
+
create_table :ar_author_addresses, :force => true do |t|
|
50
|
+
end
|
51
|
+
|
52
|
+
create_table :ar_author_favorites, :force => true do |t|
|
53
|
+
t.column :author_id, :integer
|
54
|
+
t.column :favorite_author_id, :integer
|
55
|
+
end
|
56
|
+
|
57
|
+
create_table :ar_auto_id_tests, :force => true, :id => false do |t|
|
58
|
+
t.primary_key :auto_id
|
59
|
+
t.integer :value
|
60
|
+
end
|
61
|
+
|
62
|
+
create_table :ar_binaries, :force => true do |t|
|
63
|
+
t.string :name
|
64
|
+
t.binary :data
|
65
|
+
t.binary :short_data, :limit => 2048
|
66
|
+
end
|
67
|
+
|
68
|
+
create_table :ar_birds, :force => true do |t|
|
69
|
+
t.string :name
|
70
|
+
t.string :color
|
71
|
+
t.integer :pirate_id
|
72
|
+
end
|
73
|
+
|
74
|
+
create_table :ar_books, :force => true do |t|
|
75
|
+
t.integer :author_id
|
76
|
+
t.column :name, :string
|
77
|
+
end
|
78
|
+
|
79
|
+
create_table :ar_booleans, :force => true do |t|
|
80
|
+
t.boolean :value
|
81
|
+
t.boolean :has_fun, :null => false, :default => false
|
82
|
+
end
|
83
|
+
|
84
|
+
create_table :ar_bulbs, :force => true do |t|
|
85
|
+
t.integer :car_id
|
86
|
+
t.string :name
|
87
|
+
t.boolean :frickinawesome
|
88
|
+
t.string :color
|
89
|
+
end
|
90
|
+
|
91
|
+
create_table "CamelCase", :force => true do |t|
|
92
|
+
t.string :name
|
93
|
+
end
|
94
|
+
|
95
|
+
create_table :ar_cars, :force => true do |t|
|
96
|
+
t.string :name
|
97
|
+
t.integer :engines_count
|
98
|
+
t.integer :wheels_count
|
99
|
+
t.timestamps
|
100
|
+
end
|
101
|
+
|
102
|
+
create_table :ar_categories, :force => true do |t|
|
103
|
+
t.string :name, :null => false
|
104
|
+
t.string :type
|
105
|
+
t.integer :categorizations_count
|
106
|
+
end
|
107
|
+
|
108
|
+
create_table :ar_categories_posts, :force => true, :id => false do |t|
|
109
|
+
t.integer :category_id, :null => false
|
110
|
+
t.integer :post_id, :null => false
|
111
|
+
end
|
112
|
+
|
113
|
+
create_table :ar_categorizations, :force => true do |t|
|
114
|
+
t.column :category_id, :integer
|
115
|
+
t.string :named_category_name
|
116
|
+
t.column :post_id, :integer
|
117
|
+
t.column :author_id, :integer
|
118
|
+
t.column :special, :boolean
|
119
|
+
end
|
120
|
+
|
121
|
+
create_table :ar_citations, :force => true do |t|
|
122
|
+
t.column :book1_id, :integer
|
123
|
+
t.column :book2_id, :integer
|
124
|
+
end
|
125
|
+
|
126
|
+
create_table :ar_clubs, :force => true do |t|
|
127
|
+
t.string :name
|
128
|
+
t.integer :category_id
|
129
|
+
end
|
130
|
+
|
131
|
+
create_table :ar_collections, :force => true do |t|
|
132
|
+
t.string :name
|
133
|
+
end
|
134
|
+
|
135
|
+
create_table :ar_colnametests, :force => true do |t|
|
136
|
+
t.integer :references, :null => false
|
137
|
+
end
|
138
|
+
|
139
|
+
create_table :ar_comments, :force => true do |t|
|
140
|
+
t.integer :post_id, :null => false
|
141
|
+
t.text :body, :null => false
|
142
|
+
t.string :type
|
143
|
+
t.integer :taggings_count, :default => 0
|
144
|
+
t.integer :children_count, :default => 0
|
145
|
+
t.integer :parent_id
|
146
|
+
end
|
147
|
+
|
148
|
+
create_table :ar_companies, :force => true do |t|
|
149
|
+
t.string :type
|
150
|
+
t.string :ruby_type
|
151
|
+
t.integer :firm_id
|
152
|
+
t.string :firm_name
|
153
|
+
t.string :name
|
154
|
+
t.integer :client_of
|
155
|
+
t.integer :rating, :default => 1
|
156
|
+
t.integer :account_id
|
157
|
+
t.string :description, :default => ""
|
158
|
+
end
|
159
|
+
|
160
|
+
add_index :ar_companies, [:firm_id, :type, :rating, :ruby_type], :name => "company_index"
|
161
|
+
|
162
|
+
create_table :ar_vegetables, :force => true do |t|
|
163
|
+
t.string :name
|
164
|
+
t.string :custom_type
|
165
|
+
end
|
166
|
+
|
167
|
+
create_table :ar_computers, :force => true do |t|
|
168
|
+
t.integer :developer, :null => false
|
169
|
+
t.integer :extendedWarranty, :null => false
|
170
|
+
end
|
171
|
+
|
172
|
+
create_table :ar_contracts, :force => true do |t|
|
173
|
+
t.integer :developer_id
|
174
|
+
t.integer :company_id
|
175
|
+
end
|
176
|
+
|
177
|
+
create_table :ar_customers, :force => true do |t|
|
178
|
+
t.string :name
|
179
|
+
t.integer :balance, :default => 0
|
180
|
+
t.string :address_street
|
181
|
+
t.string :address_city
|
182
|
+
t.string :address_country
|
183
|
+
t.string :gps_location
|
184
|
+
end
|
185
|
+
|
186
|
+
create_table :ar_dashboards, :force => true, :id => false do |t|
|
187
|
+
t.string :dashboard_id
|
188
|
+
t.string :name
|
189
|
+
end
|
190
|
+
|
191
|
+
create_table :ar_developers, :force => true do |t|
|
192
|
+
t.string :name
|
193
|
+
t.integer :salary, :default => 70000
|
194
|
+
t.datetime :created_at
|
195
|
+
t.datetime :updated_at
|
196
|
+
end
|
197
|
+
|
198
|
+
create_table :ar_developers_projects, :force => true, :id => false do |t|
|
199
|
+
t.integer :developer_id, :null => false
|
200
|
+
t.integer :project_id, :null => false
|
201
|
+
t.date :joined_on
|
202
|
+
t.integer :access_level, :default => 1
|
203
|
+
end
|
204
|
+
|
205
|
+
create_table :ar_dog_lovers, :force => true do |t|
|
206
|
+
t.integer :trained_dogs_count, :default => 0
|
207
|
+
t.integer :bred_dogs_count, :default => 0
|
208
|
+
end
|
209
|
+
|
210
|
+
create_table :ar_dogs, :force => true do |t|
|
211
|
+
t.integer :trainer_id
|
212
|
+
t.integer :breeder_id
|
213
|
+
end
|
214
|
+
|
215
|
+
create_table :ar_edges, :force => true, :id => false do |t|
|
216
|
+
t.column :source_id, :integer, :null => false
|
217
|
+
t.column :sink_id, :integer, :null => false
|
218
|
+
end
|
219
|
+
add_index :ar_edges, [:source_id, :sink_id], :unique => true, :name => 'unique_edge_index'
|
220
|
+
|
221
|
+
create_table :ar_engines, :force => true do |t|
|
222
|
+
t.integer :car_id
|
223
|
+
end
|
224
|
+
|
225
|
+
create_table :ar_entrants, :force => true do |t|
|
226
|
+
t.string :name, :null => false
|
227
|
+
t.integer :course_id, :null => false
|
228
|
+
end
|
229
|
+
|
230
|
+
create_table :ar_essays, :force => true do |t|
|
231
|
+
t.string :name
|
232
|
+
t.string :writer_id
|
233
|
+
t.string :writer_type
|
234
|
+
t.string :category_id
|
235
|
+
t.string :author_id
|
236
|
+
end
|
237
|
+
|
238
|
+
create_table :ar_events, :force => true do |t|
|
239
|
+
t.string :title, :limit => 5
|
240
|
+
end
|
241
|
+
|
242
|
+
create_table :ar_eyes, :force => true do |t|
|
243
|
+
end
|
244
|
+
|
245
|
+
create_table :ar_funny_jokes, :force => true do |t|
|
246
|
+
t.string :name
|
247
|
+
end
|
248
|
+
|
249
|
+
create_table :ar_cold_jokes, :force => true do |t|
|
250
|
+
t.string :name
|
251
|
+
end
|
252
|
+
|
253
|
+
create_table :ar_friendships, :force => true do |t|
|
254
|
+
t.integer :friend_id
|
255
|
+
t.integer :person_id
|
256
|
+
end
|
257
|
+
|
258
|
+
create_table :ar_goofy_string_id, :force => true, :id => false do |t|
|
259
|
+
t.string :id, :null => false
|
260
|
+
t.string :info
|
261
|
+
end
|
262
|
+
|
263
|
+
create_table :ar_having, :force => true do |t|
|
264
|
+
t.string :where
|
265
|
+
end
|
266
|
+
|
267
|
+
create_table :ar_guids, :force => true do |t|
|
268
|
+
t.column :key, :string
|
269
|
+
end
|
270
|
+
|
271
|
+
create_table :ar_inept_wizards, :force => true do |t|
|
272
|
+
t.column :name, :string, :null => false
|
273
|
+
t.column :city, :string, :null => false
|
274
|
+
t.column :type, :string
|
275
|
+
end
|
276
|
+
|
277
|
+
create_table :ar_integer_limits, :force => true do |t|
|
278
|
+
t.integer :"c_int_without_limit"
|
279
|
+
(1..8).each do |i|
|
280
|
+
t.integer :"c_int_#{i}", :limit => i
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
create_table :ar_invoices, :force => true do |t|
|
285
|
+
t.integer :balance
|
286
|
+
t.datetime :updated_at
|
287
|
+
end
|
288
|
+
|
289
|
+
create_table :ar_iris, :force => true do |t|
|
290
|
+
t.references :eye
|
291
|
+
t.string :color
|
292
|
+
end
|
293
|
+
|
294
|
+
create_table :ar_items, :force => true do |t|
|
295
|
+
t.column :name, :string
|
296
|
+
end
|
297
|
+
|
298
|
+
create_table :ar_jobs, :force => true do |t|
|
299
|
+
t.integer :ideal_reference_id
|
300
|
+
end
|
301
|
+
|
302
|
+
create_table :ar_keyboards, :force => true, :id => false do |t|
|
303
|
+
t.primary_key :key_number
|
304
|
+
t.string :name
|
305
|
+
end
|
306
|
+
|
307
|
+
create_table :ar_legacy_things, :force => true do |t|
|
308
|
+
t.integer :tps_report_number
|
309
|
+
t.integer :version, :null => false, :default => 0
|
310
|
+
end
|
311
|
+
|
312
|
+
create_table :ar_lessons, :force => true do |t|
|
313
|
+
t.string :name
|
314
|
+
end
|
315
|
+
|
316
|
+
create_table :ar_lessons_students, :id => false, :force => true do |t|
|
317
|
+
t.references :lesson
|
318
|
+
t.references :student
|
319
|
+
end
|
320
|
+
|
321
|
+
create_table :ar_lint_models, :force => true
|
322
|
+
|
323
|
+
create_table :ar_line_items, :force => true do |t|
|
324
|
+
t.integer :invoice_id
|
325
|
+
t.integer :amount
|
326
|
+
end
|
327
|
+
|
328
|
+
create_table :ar_lock_without_defaults, :force => true do |t|
|
329
|
+
t.column :lock_version, :integer
|
330
|
+
end
|
331
|
+
|
332
|
+
create_table :ar_lock_without_defaults_cust, :force => true do |t|
|
333
|
+
t.column :custom_lock_version, :integer
|
334
|
+
end
|
335
|
+
|
336
|
+
create_table :ar_mateys, :id => false, :force => true do |t|
|
337
|
+
t.column :pirate_id, :integer
|
338
|
+
t.column :target_id, :integer
|
339
|
+
t.column :weight, :integer
|
340
|
+
end
|
341
|
+
|
342
|
+
create_table :ar_members, :force => true do |t|
|
343
|
+
t.string :name
|
344
|
+
t.integer :member_type_id
|
345
|
+
end
|
346
|
+
|
347
|
+
create_table :ar_member_details, :force => true do |t|
|
348
|
+
t.integer :member_id
|
349
|
+
t.integer :organization_id
|
350
|
+
t.string :extra_data
|
351
|
+
end
|
352
|
+
|
353
|
+
create_table :ar_memberships, :force => true do |t|
|
354
|
+
t.datetime :joined_on
|
355
|
+
t.integer :club_id, :member_id
|
356
|
+
t.boolean :favourite, :default => false
|
357
|
+
t.string :type
|
358
|
+
end
|
359
|
+
|
360
|
+
create_table :ar_member_types, :force => true do |t|
|
361
|
+
t.string :name
|
362
|
+
end
|
363
|
+
|
364
|
+
create_table :ar_minivans, :force => true, :id => false do |t|
|
365
|
+
t.string :minivan_id
|
366
|
+
t.string :name
|
367
|
+
t.string :speedometer_id
|
368
|
+
t.string :color
|
369
|
+
end
|
370
|
+
|
371
|
+
create_table :ar_minimalistics, :force => true do |t|
|
372
|
+
end
|
373
|
+
|
374
|
+
create_table :ar_mixed_case_monkeys, :force => true, :id => false do |t|
|
375
|
+
t.primary_key :monkeyID
|
376
|
+
t.integer :fleaCount
|
377
|
+
end
|
378
|
+
|
379
|
+
create_table :ar_mixins, :force => true do |t|
|
380
|
+
t.integer :parent_id
|
381
|
+
t.integer :pos
|
382
|
+
t.datetime :created_at
|
383
|
+
t.datetime :updated_at
|
384
|
+
t.integer :lft
|
385
|
+
t.integer :rgt
|
386
|
+
t.integer :root_id
|
387
|
+
t.string :type
|
388
|
+
end
|
389
|
+
|
390
|
+
create_table :ar_movies, :force => true, :id => false do |t|
|
391
|
+
t.primary_key :movieid
|
392
|
+
t.string :name
|
393
|
+
end
|
394
|
+
|
395
|
+
create_table :ar_numeric_data, :force => true do |t|
|
396
|
+
t.decimal :bank_balance, :precision => 10, :scale => 2
|
397
|
+
t.decimal :big_bank_balance, :precision => 15, :scale => 2
|
398
|
+
t.decimal :world_population, :precision => 10, :scale => 0
|
399
|
+
t.decimal :my_house_population, :precision => 2, :scale => 0
|
400
|
+
t.decimal :decimal_number_with_default, :precision => 3, :scale => 2, :default => 2.78
|
401
|
+
t.float :temperature
|
402
|
+
#t.decimal :atoms_in_universe, :precision => 55, :scale => 0
|
403
|
+
# Teradata only supports 38
|
404
|
+
t.decimal :atoms_in_universe, :precision => 38, :scale => 0
|
405
|
+
end
|
406
|
+
|
407
|
+
create_table :ar_orders, :force => true do |t|
|
408
|
+
t.string :name
|
409
|
+
t.integer :billing_customer_id
|
410
|
+
t.integer :shipping_customer_id
|
411
|
+
end
|
412
|
+
|
413
|
+
create_table :ar_organizations, :force => true do |t|
|
414
|
+
t.string :name
|
415
|
+
end
|
416
|
+
|
417
|
+
create_table :ar_owners, :primary_key => :owner_id ,:force => true do |t|
|
418
|
+
t.string :name
|
419
|
+
t.column :updated_at, :datetime
|
420
|
+
t.column :happy_at, :datetime
|
421
|
+
t.string :essay_id
|
422
|
+
end
|
423
|
+
|
424
|
+
create_table :ar_paint_colors, :force => true do |t|
|
425
|
+
t.integer :non_poly_one_id
|
426
|
+
end
|
427
|
+
|
428
|
+
create_table :ar_paint_textures, :force => true do |t|
|
429
|
+
t.integer :non_poly_two_id
|
430
|
+
end
|
431
|
+
|
432
|
+
create_table :ar_parrots, :force => true do |t|
|
433
|
+
t.column :name, :string
|
434
|
+
t.column :parrot_sti_class, :string
|
435
|
+
t.column :killer_id, :integer
|
436
|
+
t.column :created_at, :datetime
|
437
|
+
t.column :created_on, :datetime
|
438
|
+
t.column :updated_at, :datetime
|
439
|
+
t.column :updated_on, :datetime
|
440
|
+
end
|
441
|
+
|
442
|
+
create_table :ar_parrots_pirates, :id => false, :force => true do |t|
|
443
|
+
t.column :parrot_id, :integer
|
444
|
+
t.column :pirate_id, :integer
|
445
|
+
end
|
446
|
+
|
447
|
+
create_table :ar_parrots_treasures, :id => false, :force => true do |t|
|
448
|
+
t.column :parrot_id, :integer
|
449
|
+
t.column :treasure_id, :integer
|
450
|
+
end
|
451
|
+
|
452
|
+
create_table :ar_people, :force => true do |t|
|
453
|
+
t.string :first_name, :null => false
|
454
|
+
t.references :primary_contact
|
455
|
+
t.string :gender, :limit => 1
|
456
|
+
t.references :number1_fan
|
457
|
+
t.integer :lock_version, :null => false, :default => 0
|
458
|
+
t.string :comments
|
459
|
+
t.integer :followers_count, :default => 0
|
460
|
+
t.references :best_friend
|
461
|
+
t.references :best_friend_of
|
462
|
+
t.integer :insures, :null => false, :default => 0
|
463
|
+
t.timestamps
|
464
|
+
end
|
465
|
+
|
466
|
+
create_table :ar_peoples_treasures, :id => false, :force => true do |t|
|
467
|
+
t.column :rich_person_id, :integer
|
468
|
+
t.column :treasure_id, :integer
|
469
|
+
end
|
470
|
+
|
471
|
+
create_table :ar_pets, :primary_key => :pet_id ,:force => true do |t|
|
472
|
+
t.string :name
|
473
|
+
t.integer :owner_id, :integer
|
474
|
+
t.timestamps
|
475
|
+
end
|
476
|
+
|
477
|
+
create_table :ar_pirates, :force => true do |t|
|
478
|
+
t.column :catchphrase, :string
|
479
|
+
t.column :parrot_id, :integer
|
480
|
+
t.integer :non_validated_parrot_id
|
481
|
+
t.column :created_on, :datetime
|
482
|
+
t.column :updated_on, :datetime
|
483
|
+
end
|
484
|
+
|
485
|
+
create_table :ar_posts, :force => true do |t|
|
486
|
+
t.integer :author_id
|
487
|
+
t.string :title, :null => false
|
488
|
+
t.text :body, :null => false
|
489
|
+
t.string :type
|
490
|
+
t.integer :comments_count, :default => 0
|
491
|
+
t.integer :taggings_count, :default => 0
|
492
|
+
t.integer :taggings_with_delete_all_count, :default => 0
|
493
|
+
t.integer :taggings_with_destroy_count, :default => 0
|
494
|
+
t.integer :tags_count, :default => 0
|
495
|
+
t.integer :tags_with_destroy_count, :default => 0
|
496
|
+
t.integer :tags_with_nullify_count, :default => 0
|
497
|
+
end
|
498
|
+
|
499
|
+
create_table :ar_price_estimates, :force => true do |t|
|
500
|
+
t.string :estimate_of_type
|
501
|
+
t.integer :estimate_of_id
|
502
|
+
t.integer :price
|
503
|
+
end
|
504
|
+
|
505
|
+
create_table :ar_products, :force => true do |t|
|
506
|
+
t.references :collection
|
507
|
+
t.string :name
|
508
|
+
end
|
509
|
+
|
510
|
+
create_table :ar_projects, :force => true do |t|
|
511
|
+
t.string :name
|
512
|
+
t.string :type
|
513
|
+
end
|
514
|
+
|
515
|
+
create_table :ar_ratings, :force => true do |t|
|
516
|
+
t.integer :comment_id
|
517
|
+
t.integer :value
|
518
|
+
end
|
519
|
+
|
520
|
+
create_table :ar_readers, :force => true do |t|
|
521
|
+
t.integer :post_id, :null => false
|
522
|
+
t.integer :person_id, :null => false
|
523
|
+
t.boolean :skimmer, :default => false
|
524
|
+
end
|
525
|
+
|
526
|
+
create_table :ar_references, :force => true do |t|
|
527
|
+
t.integer :person_id
|
528
|
+
t.integer :job_id
|
529
|
+
t.boolean :favourite
|
530
|
+
t.integer :lock_version, :default => 0
|
531
|
+
end
|
532
|
+
|
533
|
+
create_table :ar_shape_expressions, :force => true do |t|
|
534
|
+
t.string :paint_type
|
535
|
+
t.integer :paint_id
|
536
|
+
t.string :shape_type
|
537
|
+
t.integer :shape_id
|
538
|
+
end
|
539
|
+
|
540
|
+
create_table :ar_ships, :force => true do |t|
|
541
|
+
t.string :name
|
542
|
+
t.integer :pirate_id
|
543
|
+
t.integer :update_only_pirate_id
|
544
|
+
t.datetime :created_at
|
545
|
+
t.datetime :created_on
|
546
|
+
t.datetime :updated_at
|
547
|
+
t.datetime :updated_on
|
548
|
+
end
|
549
|
+
|
550
|
+
create_table :ar_ship_parts, :force => true do |t|
|
551
|
+
t.string :name
|
552
|
+
t.integer :ship_id
|
553
|
+
end
|
554
|
+
|
555
|
+
create_table :ar_speedometers, :force => true, :id => false do |t|
|
556
|
+
t.string :speedometer_id
|
557
|
+
t.string :name
|
558
|
+
t.string :dashboard_id
|
559
|
+
end
|
560
|
+
|
561
|
+
create_table :ar_sponsors, :force => true do |t|
|
562
|
+
t.integer :club_id
|
563
|
+
t.integer :sponsorable_id
|
564
|
+
t.string :sponsorable_type
|
565
|
+
end
|
566
|
+
|
567
|
+
create_table :ar_string_key_objects, :id => false, :primary_key => :id, :force => true do |t|
|
568
|
+
t.string :id
|
569
|
+
t.string :name
|
570
|
+
t.integer :lock_version, :null => false, :default => 0
|
571
|
+
end
|
572
|
+
|
573
|
+
create_table :ar_students, :force => true do |t|
|
574
|
+
t.string :name
|
575
|
+
end
|
576
|
+
|
577
|
+
create_table :ar_subscribers, :force => true, :id => false do |t|
|
578
|
+
t.string :nick, :null => false
|
579
|
+
t.string :name
|
580
|
+
t.column :books_count, :integer, :null => false, :default => 0
|
581
|
+
end
|
582
|
+
add_index :ar_subscribers, :nick, :unique => true
|
583
|
+
|
584
|
+
create_table :ar_subscriptions, :force => true do |t|
|
585
|
+
t.string :subscriber_id
|
586
|
+
t.integer :book_id
|
587
|
+
end
|
588
|
+
|
589
|
+
create_table :ar_tags, :force => true do |t|
|
590
|
+
t.column :name, :string
|
591
|
+
t.column :taggings_count, :integer, :default => 0
|
592
|
+
end
|
593
|
+
|
594
|
+
create_table :ar_taggings, :force => true do |t|
|
595
|
+
t.column :tag_id, :integer
|
596
|
+
t.column :super_tag_id, :integer
|
597
|
+
t.column :taggable_type, :string
|
598
|
+
t.column :taggable_id, :integer
|
599
|
+
t.string :comment
|
600
|
+
end
|
601
|
+
|
602
|
+
create_table :ar_tasks, :force => true do |t|
|
603
|
+
t.datetime :starting
|
604
|
+
t.datetime :ending
|
605
|
+
end
|
606
|
+
|
607
|
+
create_table :ar_topics, :force => true do |t|
|
608
|
+
t.string :title
|
609
|
+
t.string :author_name
|
610
|
+
t.string :author_email_address
|
611
|
+
t.datetime :written_on
|
612
|
+
t.time :bonus_time
|
613
|
+
t.date :last_read
|
614
|
+
t.text :content
|
615
|
+
t.text :important
|
616
|
+
t.boolean :approved, :default => true
|
617
|
+
t.integer :replies_count, :default => 0
|
618
|
+
t.integer :parent_id
|
619
|
+
t.string :parent_title
|
620
|
+
t.string :type
|
621
|
+
t.string :group
|
622
|
+
t.timestamps
|
623
|
+
end
|
624
|
+
|
625
|
+
create_table :ar_toys, :primary_key => :toy_id ,:force => true do |t|
|
626
|
+
t.string :name
|
627
|
+
t.integer :pet_id, :integer
|
628
|
+
t.timestamps
|
629
|
+
end
|
630
|
+
|
631
|
+
create_table :ar_traffic_lights, :force => true do |t|
|
632
|
+
t.string :location
|
633
|
+
t.string :state
|
634
|
+
t.datetime :created_at
|
635
|
+
t.datetime :updated_at
|
636
|
+
end
|
637
|
+
|
638
|
+
create_table :ar_treasures, :force => true do |t|
|
639
|
+
t.column :name, :string
|
640
|
+
t.column :looter_id, :integer
|
641
|
+
t.column :looter_type, :string
|
642
|
+
end
|
643
|
+
|
644
|
+
create_table :ar_tyres, :force => true do |t|
|
645
|
+
t.integer :car_id
|
646
|
+
end
|
647
|
+
|
648
|
+
create_table :ar_variants, :force => true do |t|
|
649
|
+
t.references :product
|
650
|
+
t.string :name
|
651
|
+
end
|
652
|
+
|
653
|
+
create_table :ar_vertices, :force => true do |t|
|
654
|
+
t.column :label, :string
|
655
|
+
end
|
656
|
+
|
657
|
+
create_table 'warehouse-things', :force => true do |t|
|
658
|
+
t.integer :value
|
659
|
+
end
|
660
|
+
|
661
|
+
[:circles, :squares, :triangles, :non_poly_ones, :non_poly_twos].each do |t|
|
662
|
+
create_table(t, :force => true) { }
|
663
|
+
end
|
664
|
+
|
665
|
+
# NOTE - the following 4 tables are used by models that have :inverse_of options on the associations
|
666
|
+
create_table :ar_men, :force => true do |t|
|
667
|
+
t.string :name
|
668
|
+
end
|
669
|
+
|
670
|
+
create_table :ar_faces, :force => true do |t|
|
671
|
+
t.string :description
|
672
|
+
t.integer :man_id
|
673
|
+
t.integer :polymorphic_man_id
|
674
|
+
t.string :polymorphic_man_type
|
675
|
+
t.integer :horrible_polymorphic_man_id
|
676
|
+
t.string :horrible_polymorphic_man_type
|
677
|
+
end
|
678
|
+
|
679
|
+
create_table :ar_interests, :force => true do |t|
|
680
|
+
t.string :topic
|
681
|
+
t.integer :man_id
|
682
|
+
t.integer :polymorphic_man_id
|
683
|
+
t.string :polymorphic_man_type
|
684
|
+
t.integer :zine_id
|
685
|
+
end
|
686
|
+
|
687
|
+
create_table :ar_wheels, :force => true do |t|
|
688
|
+
t.references :wheelable, :polymorphic => true
|
689
|
+
end
|
690
|
+
|
691
|
+
create_table :ar_zines, :force => true do |t|
|
692
|
+
t.string :title
|
693
|
+
end
|
694
|
+
|
695
|
+
create_table :ar_countries, :force => true, :id => false, :primary_key => 'country_id' do |t|
|
696
|
+
t.string :country_id
|
697
|
+
t.string :name
|
698
|
+
end
|
699
|
+
create_table :ar_treaties, :force => true, :id => false, :primary_key => 'treaty_id' do |t|
|
700
|
+
t.string :treaty_id
|
701
|
+
t.string :name
|
702
|
+
end
|
703
|
+
create_table :ar_countries_treaties, :force => true, :id => false do |t|
|
704
|
+
t.string :country_id, :null => false
|
705
|
+
t.string :treaty_id, :null => false
|
706
|
+
end
|
707
|
+
|
708
|
+
create_table :ar_liquid, :force => true do |t|
|
709
|
+
t.string :name
|
710
|
+
end
|
711
|
+
create_table :ar_molecules, :force => true do |t|
|
712
|
+
t.integer :liquid_id
|
713
|
+
t.string :name
|
714
|
+
end
|
715
|
+
create_table :ar_electrons, :force => true do |t|
|
716
|
+
t.integer :molecule_id
|
717
|
+
t.string :name
|
718
|
+
end
|
719
|
+
create_table :ar_weirds, :force => true do |t|
|
720
|
+
t.string 'a$b'
|
721
|
+
end
|
722
|
+
|
723
|
+
# fk_test_has_fk should be before fk_test_has_pk
|
724
|
+
create_table :ar_fk_test_has_fk, :force => true do |t|
|
725
|
+
t.integer :fk_id, :null => false
|
726
|
+
end
|
727
|
+
|
728
|
+
create_table :ar_fk_test_has_pk, :force => true do |t|
|
729
|
+
end
|
730
|
+
|
731
|
+
end
|
732
|
+
end
|