public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Use schema.rb for all databases

Move adapter specific schema into their own files

Signed-off-by: Michael Koziarski <michael@koziarski.com>
fcheung (author)
Mon Apr 21 03:00:01 -0700 2008
NZKoz (committer)
Mon Apr 21 18:55:13 -0700 2008
commit  a4fc93c3a9f59dcd7cf56c6ae1cb1fb749f6678b
tree    b45689a4b8ab2d55b475986e0d49519906f55c44
parent  0a94f16b9532894aeb7aed2aec5082dd3b521414
...
617
618
619
620
 
621
622
623
...
617
618
619
 
620
621
622
623
0
@@ -617,7 +617,7 @@ module ActiveRecord
0
             quoted_sequence = quote_column_name(sequence)
0
 
0
             select_value <<-end_sql, 'Reset sequence'
0
- SELECT setval('#{sequence}', (SELECT COALESCE(MAX(#{pk})+(SELECT increment_by FROM #{quoted_sequence}), (SELECT min_value FROM #{quoted_sequence})) FROM #{quote_table_name(table)}), false)
0
+ SELECT setval('#{quoted_sequence}', (SELECT COALESCE(MAX(#{quote_column_name pk})+(SELECT increment_by FROM #{quoted_sequence}), (SELECT min_value FROM #{quoted_sequence})) FROM #{quote_table_name(table)}), false)
0
             end_sql
0
           else
0
             @logger.warn "#{table} has primary key #{pk} with no default sequence" if @logger
...
4
5
6
7
8
9
10
11
12
13
14
15
16
 
 
 
17
18
19
20
21
22
23
24
25
 
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 
 
 
68
...
4
5
6
 
 
 
 
 
7
 
 
 
 
8
9
10
11
12
13
14
15
 
 
 
 
16
17
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
22
23
24
0
@@ -4,65 +4,21 @@ require "cases/helper"
0
 class AAACreateTablesTest < ActiveRecord::TestCase
0
   self.use_transactional_fixtures = false
0
 
0
- def test_drop_and_create_main_tables
0
- recreate ActiveRecord::Base unless use_migrations?
0
- assert true
0
- end
0
-
0
   def test_load_schema
0
- if ActiveRecord::Base.connection.supports_migrations?
0
- eval(File.read(SCHEMA_ROOT + "/schema.rb"))
0
- else
0
- recreate ActiveRecord::Base, '3'
0
+ eval(File.read(SCHEMA_ROOT + "/schema.rb"))
0
+ if File.exists?(adapter_specific_schema_file)
0
+ eval(File.read(adapter_specific_schema_file))
0
     end
0
     assert true
0
   end
0
 
0
   def test_drop_and_create_courses_table
0
- if Course.connection.supports_migrations?
0
- eval(File.read(SCHEMA_ROOT + "/schema2.rb"))
0
- end
0
- recreate Course, '2' unless use_migrations_for_courses?
0
+ eval(File.read(SCHEMA_ROOT + "/schema2.rb"))
0
     assert true
0
   end
0
 
0
   private
0
- def use_migrations?
0
- unittest_sql_filename = ActiveRecord::Base.connection.adapter_name.downcase + ".sql"
0
- not File.exist? SCHEMA_ROOT + "/#{unittest_sql_filename}"
0
- end
0
-
0
- def use_migrations_for_courses?
0
- unittest2_sql_filename = ActiveRecord::Base.connection.adapter_name.downcase + "2.sql"
0
- not File.exist? SCHEMA_ROOT + "/#{unittest2_sql_filename}"
0
- end
0
-
0
- def recreate(base, suffix = nil)
0
- connection = base.connection
0
- adapter_name = connection.adapter_name.downcase + suffix.to_s
0
- execute_sql_file SCHEMA_ROOT + "/#{adapter_name}.drop.sql", connection
0
- execute_sql_file SCHEMA_ROOT + "/#{adapter_name}.sql", connection
0
- end
0
-
0
- def execute_sql_file(path, connection)
0
- # OpenBase has a different format for sql files
0
- if current_adapter?(:OpenBaseAdapter) then
0
- File.read(path).split("go").each_with_index do |sql, i|
0
- begin
0
- # OpenBase does not support comments embedded in sql
0
- connection.execute(sql,"SQL statement ##{i}") unless sql.blank?
0
- rescue ActiveRecord::StatementInvalid
0
- #$stderr.puts "warning: #{$!}"
0
- end
0
- end
0
- else
0
- File.read(path).split(';').each_with_index do |sql, i|
0
- begin
0
- connection.execute("\n\n-- statement ##{i}\n#{sql}\n") unless sql.blank?
0
- rescue ActiveRecord::StatementInvalid
0
- #$stderr.puts "warning: #{$!}"
0
- end
0
- end
0
- end
0
- end
0
+ def adapter_specific_schema_file
0
+ SCHEMA_ROOT + '/' + ActiveRecord::Base.connection.adapter_name.downcase + '_specific_schema.rb'
0
+ end
0
 end
...
25
26
27
28
 
29
30
31
...
25
26
27
 
28
29
30
31
0
@@ -25,7 +25,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
0
     new_person = nil # so block binding catches it
0
     
0
     assert_queries(0) do
0
- new_person = Person.new
0
+ new_person = Person.new :first_name => 'bob'
0
     end
0
     
0
     # Associating new records always saves them
...
41
42
43
44
 
45
46
47
...
41
42
43
 
44
45
46
47
0
@@ -41,7 +41,7 @@ class AssociationsTest < ActiveRecord::TestCase
0
   end
0
 
0
   def test_should_construct_new_finder_sql_after_create
0
- person = Person.new
0
+ person = Person.new :first_name => 'clark'
0
     assert_equal [], person.readers.find(:all)
0
     person.save!
0
     reader = Reader.create! :person => person, :post => Post.new(:title => "foo", :body => "bar")
...
1704
1705
1706
1707
 
1708
1709
1710
...
1704
1705
1706
 
1707
1708
1709
1710
0
@@ -1704,7 +1704,7 @@ class BasicsTest < ActiveRecord::TestCase
0
     old_class = LooseDescendant
0
     Object.send :remove_const, :LooseDescendant
0
 
0
- descendant = old_class.create!
0
+ descendant = old_class.create! :first_name => 'bob'
0
     assert_not_nil LoosePerson.find(descendant.id), "Should have found instance of LooseDescendant when finding abstract LoosePerson: #{descendant.inspect}"
0
   ensure
0
     unless Object.const_defined?(:LooseDescendant)
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 
 
 
 
70
 
71
72
73
74
 
 
 
 
 
 
 
 
 
75
 
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
 
 
 
 
 
 
93
94
95
96
97
98
99
 
 
 
 
100
101
102
103
104
 
 
 
 
 
105
106
107
108
 
 
109
110
111
112
113
 
 
 
 
114
115
116
117
118
119
120
121
 
 
 
 
122
123
124
125
126
 
 
 
127
128
129
130
131
132
133
134
135
136
137
 
 
 
138
139
140
141
142
 
 
 
143
144
145
146
147
148
149
150
 
 
 
 
151
152
153
154
155
156
 
 
 
 
157
158
159
160
161
 
 
 
 
 
162
163
164
165
166
167
168
169
 
 
 
 
170
171
172
173
174
 
 
 
175
176
177
178
179
 
 
 
180
181
182
183
184
185
 
 
 
 
 
186
187
188
189
190
 
 
 
 
 
 
 
 
191
192
193
194
195
196
197
198
199
200
201
202
203
204
 
 
 
 
205
206
 
 
 
 
 
 
 
 
207
208
 
 
 
 
 
 
209
210
211
212
213
 
 
 
 
 
 
214
215
216
 
 
 
 
 
217
218
219
220
 
 
 
 
221
222
223
 
 
224
225
226
227
228
229
230
231
232
233
 
 
234
235
236
237
238
239
240
 
 
 
 
241
242
243
244
245
 
 
 
246
247
248
249
250
251
 
 
 
252
253
254
255
256
 
 
 
257
258
 
 
259
260
261
262
263
 
 
 
 
264
265
266
267
 
 
268
269
270
271
272
 
 
 
 
 
273
274
275
276
277
 
278
279
280
281
 
 
 
282
283
284
285
 
 
 
 
 
 
 
 
 
286
287
288
289
290
291
292
 
 
 
293
294
295
296
297
298
299
 
 
 
 
 
 
300
301
302
303
304
 
 
 
 
305
306
307
308
 
 
309
310
311
312
313
 
 
 
314
315
316
317
318
319
 
 
320
321
322
...
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
 
 
 
359
360
361
 
362
363
364
365
366
 
367
368
369
370
 
 
 
 
 
371
372
373
374
375
376
377
378
379
 
 
 
 
 
 
 
380
381
382
...
385
386
387
388
389
 
 
 
 
 
 
 
 
390
391
392
...
396
397
398
399
400
 
 
 
 
 
 
401
402
403
404
 
 
 
 
405
406
407
 
 
408
409
 
410
411
412
 
 
 
413
414
415
416
417
418
419
 
 
 
 
 
 
 
 
 
 
 
 
420
421
422
423
424
425
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
427
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
3
4
5
6
7
8
 
 
 
9
10
11
12
13
14
15
16
17
18
19
20
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
23
24
25
26
27
28
 
 
 
 
 
 
29
30
31
32
33
 
 
 
 
34
35
36
37
38
39
 
 
 
40
41
42
 
 
 
 
43
44
45
46
47
 
 
 
 
48
 
 
49
50
51
52
53
 
 
 
 
54
55
56
57
 
 
 
 
 
 
 
 
 
 
58
59
60
61
 
 
 
 
62
63
64
65
 
 
 
 
 
 
 
66
67
68
69
70
 
 
 
 
 
71
72
73
74
75
 
 
 
 
76
77
78
79
80
81
 
 
 
 
 
 
 
82
83
84
85
86
 
 
 
 
87
88
89
90
 
 
 
 
91
92
93
94
 
 
 
 
 
95
96
97
98
99
100
 
 
 
 
101
102
103
104
105
106
107
108
109
 
 
 
 
 
 
 
 
 
 
 
 
 
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
 
125
126
127
128
129
130
131
 
 
 
 
132
133
134
135
136
137
138
 
 
139
140
141
142
143
144
 
 
145
146
147
148
149
150
 
 
151
152
153
154
 
 
 
 
 
 
 
 
155
156
157
158
 
 
 
 
 
159
160
161
162
163
164
 
 
 
165
166
167
168
169
 
 
 
 
170
171
172
173
174
 
 
 
175
176
177
178
 
179
180
181
182
 
 
 
183
184
185
186
187
188
 
 
189
190
191
192
 
 
 
193
194
195
196
197
198
 
199
 
 
200
201
202
 
 
203
204
205
206
207
 
 
208
209
210
211
212
213
214
215
216
217
218
 
 
 
 
 
219
220
221
222
223
 
 
 
 
 
224
225
226
227
228
229
230
231
 
 
 
232
233
234
235
236
237
 
 
238
239
240
241
 
 
 
242
243
244
245
246
 
 
 
 
247
248
249
250
251
...
258
259
260
 
 
 
 
 
 
 
261
262
263
264
265
 
 
 
 
 
 
266
267
268
269
270
 
 
 
 
271
272
273
274
275
 
276
277
 
 
 
 
278
279
280
 
 
281
282
283
284
285
286
287
 
 
 
 
 
 
 
288
289
290
291
292
293
294
295
296
297
...
300
301
302
 
 
303
304
305
306
307
308
309
310
311
312
313
...
317
318
319
 
 
320
321
322
323
324
325
326
327
 
 
328
329
330
331
332
333
 
334
335
336
337
338
339
 
 
340
341
342
343
344
 
 
 
 
 
345
346
347
348
349
350
351
352
353
354
355
356
357
358
 
 
 
 
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
0
@@ -1,322 +1,251 @@
0
-ActiveRecord::Schema.define do
0
-
0
- # adapter name is checked because we are under a transition of
0
- # moving the sql files under activerecord/test/fixtures/db_definitions
0
- # to this file, schema.rb.
0
- if adapter_name == "MySQL"
0
-
0
- # Please keep these create table statements in alphabetical order
0
- # unless the ordering matters. In which case, define them below
0
- create_table :accounts, :force => true do |t|
0
- t.integer :firm_id
0
- t.integer :credit_limit
0
- end
0
-
0
- create_table :authors, :force => true do |t|
0
- t.string :name, :null => false
0
- end
0
-
0
- create_table :auto_id_tests, :force => true, :id => false do |t|
0
- t.primary_key :auto_id
0
- t.integer :value
0
- end
0
-
0
- create_table :binaries, :force => true do |t|
0
- t.binary :data
0
- end
0
 
0
- create_table :binary_fields, :force => true do |t|
0
- t.binary :tiny_blob, :limit => 255
0
- t.binary :normal_blob, :limit => 65535
0
- t.binary :medium_blob, :limit => 16777215
0
- t.binary :long_blob, :limit => 2147483647
0
- t.text :tiny_text, :limit => 255
0
- t.text :normal_text, :limit => 65535
0
- t.text :medium_text, :limit => 16777215
0
- t.text :long_text, :limit => 2147483647
0
- end
0
-
0
- create_table :booleantests, :force => true do |t|
0
- t.integer :value
0
- end
0
-
0
- create_table :categories, :force => true do |t|
0
- t.string :name, :null => false
0
- t.string :type
0
- end
0
-
0
- create_table :categories_posts, :force => true, :id => false do |t|
0
- t.integer :category_id, :null => false
0
- t.integer :post_id, :null => false
0
- end
0
-
0
- create_table :colnametests, :force => true do |t|
0
- t.integer :references, :null => false
0
- end
0
-
0
- create_table :comments, :force => true do |t|
0
- t.integer :post_id, :null => false
0
- t.text :body, :null => false
0
- t.string :type
0
- end
0
-
0
- create_table :companies, :force => true do |t|
0
- t.string :type
0
- t.string :ruby_type
0
- t.integer :firm_id
0
- t.string :name
0
- t.integer :client_of
0
- t.integer :rating, :default => 1
0
+ActiveRecord::Schema.define do
0
+ def except(adapter_names_to_exclude)
0
+ unless [adapter_names_to_exclude].flatten.include?(adapter_name)
0
+ yield
0
     end
0
+ end
0
 
0
- create_table :computers, :force => true do |t|
0
- t.integer :developer, :null => false
0
- t.integer :extendedWarranty, :null => false
0
+ #put adapter specific setup here
0
+ case adapter_name
0
+ # For Firebird, set the sequence values 10000 when create_table is called;
0
+ # this prevents primary key collisions between "normally" created records
0
+ # and fixture-based (YAML) records.
0
+ when "Firebird"
0
+ def create_table(*args, &block)
0
+ ActiveRecord::Base.connection.create_table(*args, &block)
0
+ ActiveRecord::Base.connection.execute "SET GENERATOR #{args.first}_seq TO 10000"
0
     end
0
+ end
0
 
0
 
0
- create_table :customers, :force => true do |t|
0
- t.string :name
0
- t.integer :balance, :default => 0
0
- t.string :address_street
0
- t.string :address_city
0
- t.string :address_country
0
- t.string :gps_location
0
- end
0
-
0
- create_table :developers, :force => true do |t|
0
- t.string :name
0
- t.integer :salary, :default => 70000
0
- t.datetime :created_at
0
- t.datetime :updated_at
0
- end
0
+ # Please keep these create table statements in alphabetical order
0
+ # unless the ordering matters. In which case, define them below
0
+ create_table :accounts, :force => true do |t|
0
+ t.integer :firm_id
0
+ t.integer :credit_limit
0
+ end
0
 
0
- create_table :developers_projects, :force => true, :id => false do |t|
0
- t.integer :developer_id, :null => false
0
- t.integer :project_id, :null => false
0
- t.date :joined_on
0
- t.integer :access_level, :default => 1
0
- end
0
+ create_table :audit_logs, :force => true do |t|
0
+ t.column :message, :string, :null=>false
0
+ t.column :developer_id, :integer, :null=>false
0
+ end
0
 
0
- create_table :entrants, :force => true do |t|
0
- t.string :name, :null => false
0
- t.integer :course_id, :null => false
0
- end
0
+ create_table :authors, :force => true do |t|
0
+ t.string :name, :null => false
0
+ t.integer :author_address_id
0
+ t.integer :author_address_extra_id
0
+ end
0
 
0
- create_table :funny_jokes, :force => true do |t|
0
- t.string :name
0
- end
0
+ create_table :author_addresses, :force => true do |t|
0
+ end
0
 
0
- create_table :keyboards, :force => true, :id => false do |t|
0
- t.primary_key :key_number
0
- t.string :name
0
- end
0
+ create_table :author_favorites, :force => true do |t|
0
+ t.column :author_id, :integer
0
+ t.column :favorite_author_id, :integer
0
+ end
0
 
0
- create_table :legacy_things, :force => true do |t|
0
- t.integer :tps_report_number
0
- t.integer :version, :null => false, :default => 0
0
- end
0
 
0
- create_table :minimalistics, :force => true do |t|
0
- end
0
+ create_table :auto_id_tests, :force => true, :id => false do |t|
0
+ t.primary_key :auto_id
0
+ t.integer :value
0
+ end
0
 
0
- create_table :mixed_case_monkeys, :force => true, :id => false do |t|
0
- t.primary_key :monkeyID
0
- t.integer :fleaCount
0
- end
0
+ create_table :binaries, :force => true do |t|
0
+ t.binary :data
0
+ end
0
 
0
- create_table :mixins, :force => true do |t|
0
- t.integer :parent_id
0
- t.integer :pos
0
- t.datetime :created_at
0
- t.datetime :updated_at
0
- t.integer :lft
0
- t.integer :rgt
0
- t.integer :root_id
0
- t.string :type
0
- end
0
+ create_table :books, :force => true do |t|
0
+ t.column :name, :string
0
+ end
0
 
0
- create_table :movies, :force => true, :id => false do |t|
0
- t.primary_key :movieid
0
- t.string :name
0
- end
0
+ create_table :booleantests, :force => true do |t|
0
+ t.integer :value
0
+ end
0
 
0
- create_table :numeric_data, :force => true do |t|
0
- t.decimal :bank_balance, :precision => 10, :scale => 2
0
- t.decimal :big_bank_balance, :precision => 15, :scale => 2
0
- t.decimal :world_population, :precision => 10, :scale => 0
0
- t.decimal :my_house_population, :precision => 2, :scale => 0
0
- t.decimal :decimal_number_with_default, :precision => 3, :scale => 2, :default => 2.78
0
- end
0
+ create_table :categories, :force => true do |t|
0
+ t.string :name, :null => false
0
+ t.string :type
0
+ end
0
 
0
- create_table :orders, :force => true do |t|
0
- t.string :name
0
- t.integer :billing_customer_id
0
- t.integer :shipping_customer_id
0
- end
0
+ create_table :categories_posts, :force => true, :id => false do |t|
0
+ t.integer :category_id, :null => false
0
+ t.integer :post_id, :null => false
0
+ end
0
 
0
- create_table :people, :force => true do |t|
0
- t.string :first_name, :null => false
0
- t.integer :lock_version, :null => false, :default => 0
0
- end
0
+ create_table :categorizations, :force => true do |t|
0
+ t.column :category_id, :integer
0
+ t.column :post_id, :integer
0
+ t.column :author_id, :integer
0
+ end
0
 
0
- create_table :posts, :force => true do |t|
0
- t.integer :author_id
0
- t.string :title, :null => false
0
- t.text :body, :null => false
0
- t.string :type
0
- t.integer :comments_count, :default => 0
0
- end
0
+ create_table :citations, :force => true do |t|
0
+ t.column :book1_id, :integer
0
+ t.column :book2_id, :integer
0
+ end
0
 
0
- create_table :projects, :force => true do |t|
0
- t.string :name
0
- t.string :type
0
- end
0
+ create_table :clubs, :force => true do |t|
0
+ t.string :name
0
+ end
0
 
0
- create_table :readers, :force => true do |t|
0
- t.integer :post_id, :null => false
0
- t.integer :person_id, :null => false
0
- end
0
+ create_table :colnametests, :force => true do |t|
0
+ t.integer :references, :null => false
0
+ end
0
 
0
- create_table :subscribers, :force => true, :id => false do |t|
0
- t.string :nick, :null => false
0
- t.string :name
0
- end
0
- add_index :subscribers, :nick, :unique => true
0
+ create_table :comments, :force => true do |t|
0
+ t.integer :post_id, :null => false
0
+ t.text :body, :null => false
0
+ t.string :type
0
+ end
0
 
0
- create_table :tasks, :force => true do |t|
0
- t.datetime :starting
0
- t.datetime :ending
0
- end
0
+ create_table :companies, :force => true do |t|
0
+ t.string :type
0
+ t.string :ruby_type
0
+ t.integer :firm_id
0
+ t.string :name
0
+ t.integer :client_of
0
+ t.integer :rating, :default => 1
0
+ end
0
 
0
- create_table :topics, :force => true do |t|
0
- t.string :title
0
- t.string :author_name
0
- t.string :author_email_address
0
- t.datetime :written_on
0
- t.time :bonus_time
0
- t.date :last_read
0
- t.text :content
0
- t.boolean :approved, :default => true
0
- t.integer :replies_count, :default => 0
0
- t.integer :parent_id
0
- t.string :type
0
- end
0
+ create_table :computers, :force => true do |t|
0
+ t.integer :developer, :null => false
0
+ t.integer :extendedWarranty, :null => false
0
+ end
0
 
0
 
0
+ create_table :customers, :force => true do |t|
0
+ t.string :name
0
+ t.integer :balance, :default => 0
0
+ t.string :address_street
0
+ t.string :address_city
0
+ t.string :address_country
0
+ t.string :gps_location
0
+ end
0
 
0
- ### These tables are created last as the order is significant
0
+ create_table :developers, :force => true do |t|
0
+ t.string :name
0
+ t.integer :salary, :default => 70000
0
+ t.datetime :created_at
0
+ t.datetime :updated_at
0
+ end
0
 
0
- # fk_test_has_fk should be before fk_test_has_pk
0
- create_table :fk_test_has_fk, :force => true do |t|
0
- t.integer :fk_id, :null => false
0
- end
0
+ create_table :developers_projects, :force => true, :id => false do |t|
0
+ t.integer :developer_id, :null => false
0
+ t.integer :project_id, :null => false
0
+ t.date :joined_on
0
+ t.integer :access_level, :default => 1
0
+ end
0
 
0
- create_table :fk_test_has_pk, :force => true do |t|
0
- end
0
+ create_table :edges, :force => true do |t|
0
+ t.column :source_id, :integer, :null => false
0
+ t.column :sink_id, :integer, :null => false
0
+ end
0
+ add_index :edges, [:source_id, :sink_id], :unique => true, :name => 'unique_edge_index'
0
 
0
- execute 'alter table fk_test_has_fk
0
- add FOREIGN KEY (`fk_id`) REFERENCES `fk_test_has_pk`(`id`)'
0
 
0
+ create_table :entrants, :force => true do |t|
0
+ t.string :name, :null => false
0
+ t.integer :course_id, :null => false
0
+ end
0
 
0
- else
0
- add_column :posts, :comments_count, :integer, :default => 0
0
+ create_table :funny_jokes, :force => true do |t|
0
+ t.string :name
0
   end
0
 
0
- # For Firebird, set the sequence values 10000 when create_table is called;
0
- # this prevents primary key collisions between "normally" created records
0
- # and fixture-based (YAML) records.
0
- if adapter_name == "Firebird"
0
- def create_table(*args, &block)
0
- ActiveRecord::Base.connection.create_table(*args, &block)
0
- ActiveRecord::Base.connection.execute "SET GENERATOR #{args.first}_seq TO 10000"
0
- end
0
+ create_table :items, :force => true do |t|
0
+ t.column :name, :integer
0
   end
0
 
0
- create_table :taggings, :force => true do |t|
0
- t.column :tag_id, :integer
0
- t.column :super_tag_id, :integer
0
- t.column :taggable_type, :string
0
- t.column :taggable_id, :integer
0
+ create_table :inept_wizards, :force => true do |t|
0
+ t.column :name, :string, :null => false
0
+ t.column :city, :string, :null => false
0
+ t.column :type, :string
0
   end
0
 
0
- create_table :tags, :force => true do |t|
0
- t.column :name, :string
0
- t.column :taggings_count, :integer, :default => 0
0
+ create_table :keyboards, :force => true, :id => false do |t|
0
+ t.primary_key :key_number
0
+ t.string :name
0
   end
0
 
0
- create_table :categorizations, :force => true do |t|
0
- t.column :category_id, :integer
0
- t.column :post_id, :integer
0
- t.column :author_id, :integer
0
+ create_table :legacy_things, :force => true do |t|
0
+ t.integer :tps_report_number
0
+ t.integer :version, :null => false, :default => 0
0
   end
0
 
0
- add_column :posts, :taggings_count, :integer, :default => 0
0
- add_column :authors, :author_address_id, :integer
0
- add_column :authors, :author_address_extra_id, :integer
0
+ create_table :lock_without_defaults