Skip to content
Browse files

made a pass in AR's schema.rb to keep (most) create statements in lex…

…icographic order, and fixed an FK
  • Loading branch information...
1 parent 5b86c3e commit a031fc57c85b78a51769ab304fdae9c9fac6c84e @fxn fxn committed Oct 22, 2010
Showing with 60 additions and 59 deletions.
  1. +60 −59 activerecord/test/schema/schema.rb
View
119 activerecord/test/schema/schema.rb
@@ -18,8 +18,13 @@ def create_table(*args, &block)
end
- # Please keep these create table statements in alphabetical order
- # unless the ordering matters. In which case, define them below
+ # ------------------------------------------------------------------- #
+ # #
+ # Please keep these create table statements in alphabetical order #
+ # unless the ordering matters. In which case, define them below. #
+ # #
+ # ------------------------------------------------------------------- #
+
create_table :accounts, :force => true do |t|
t.integer :firm_id
t.string :firm_name
@@ -54,7 +59,6 @@ def create_table(*args, &block)
t.column :favorite_author_id, :integer
end
-
create_table :auto_id_tests, :force => true, :id => false do |t|
t.primary_key :auto_id
t.integer :value
@@ -78,6 +82,11 @@ def create_table(*args, &block)
t.boolean :value
end
+ create_table :bulbs, :force => true do |t|
+ t.integer :car_id
+ t.string :name
+ end
+
create_table "CamelCase", :force => true do |t|
t.string :name
end
@@ -156,11 +165,6 @@ def create_table(*args, &block)
t.integer :company_id
end
- create_table :iris, :force => true do |t|
- t.integer :eye
- t.string :color
- end
-
create_table :customers, :force => true do |t|
t.string :name
t.integer :balance, :default => 0
@@ -199,18 +203,6 @@ def create_table(*args, &block)
t.integer :car_id
end
- create_table :eyes, :force => true do |t|
- end
-
- create_table :tyres, :force => true do |t|
- t.integer :car_id
- end
-
- create_table :bulbs, :force => true do |t|
- t.integer :car_id
- t.string :name
- end
-
create_table :entrants, :force => true do |t|
t.string :name, :null => false
t.integer :course_id, :null => false
@@ -226,6 +218,9 @@ def create_table(*args, &block)
t.string :title, :limit => 5
end
+ create_table :eyes, :force => true do |t|
+ end
+
create_table :funny_jokes, :force => true do |t|
t.string :name
end
@@ -235,13 +230,8 @@ def create_table(*args, &block)
t.string :info
end
- create_table :invoices, :force => true do |t|
- t.integer :balance
- t.datetime :updated_at
- end
-
- create_table :items, :force => true do |t|
- t.column :name, :string
+ create_table :guids, :force => true do |t|
+ t.column :key, :string
end
create_table :inept_wizards, :force => true do |t|
@@ -250,6 +240,26 @@ def create_table(*args, &block)
t.column :type, :string
end
+ create_table :integer_limits, :force => true do |t|
+ t.integer :"c_int_without_limit"
+ (1..8).each do |i|
+ t.integer :"c_int_#{i}", :limit => i
+ end
+ end
+
+ create_table :invoices, :force => true do |t|
+ t.integer :balance
+ t.datetime :updated_at
+ end
+
+ create_table :iris, :force => true do |t|
+ t.references :eye
+ t.string :color
+ end
+
+ create_table :items, :force => true do |t|
+ t.column :name, :string
+ end
create_table :jobs, :force => true do |t|
t.integer :ideal_reference_id
@@ -306,13 +316,6 @@ def create_table(*args, &block)
t.string :name
end
- create_table :references, :force => true do |t|
- t.integer :person_id
- t.integer :job_id
- t.boolean :favourite
- t.integer :lock_version, :default => 0
- end
-
create_table :minivans, :force => true, :id => false do |t|
t.string :minivan_id
t.string :name
@@ -375,7 +378,6 @@ def create_table(*args, &block)
t.column :happy_at, :datetime
end
-
create_table :paint_colors, :force => true do |t|
t.integer :non_poly_one_id
end
@@ -462,6 +464,13 @@ def create_table(*args, &block)
t.boolean :skimmer, :default => false
end
+ create_table :references, :force => true do |t|
+ t.integer :person_id
+ t.integer :job_id
+ t.boolean :favourite
+ t.integer :lock_version, :default => 0
+ end
+
create_table :shape_expressions, :force => true do |t|
t.string :paint_type
t.integer :paint_id
@@ -506,6 +515,18 @@ def create_table(*args, &block)
t.integer :book_id
end
+ create_table :tags, :force => true do |t|
+ t.column :name, :string
+ t.column :taggings_count, :integer, :default => 0
+ end
+
+ create_table :taggings, :force => true do |t|
+ t.column :tag_id, :integer
+ t.column :super_tag_id, :integer
+ t.column :taggable_type, :string
+ t.column :taggable_id, :integer
+ end
+
create_table :tasks, :force => true do |t|
t.datetime :starting
t.datetime :ending
@@ -533,18 +554,6 @@ def create_table(*args, &block)
t.string :group
end
- create_table :taggings, :force => true do |t|
- t.column :tag_id, :integer
- t.column :super_tag_id, :integer
- t.column :taggable_type, :string
- t.column :taggable_id, :integer
- end
-
- create_table :tags, :force => true do |t|
- t.column :name, :string
- t.column :taggings_count, :integer, :default => 0
- end
-
create_table :toys, :primary_key => :toy_id ,:force => true do |t|
t.string :name
t.integer :pet_id, :integer
@@ -564,6 +573,10 @@ def create_table(*args, &block)
t.column :looter_type, :string
end
+ create_table :tyres, :force => true do |t|
+ t.integer :car_id
+ end
+
create_table :variants, :force => true do |t|
t.references :product
t.string :name
@@ -581,17 +594,6 @@ def create_table(*args, &block)
create_table(t, :force => true) { }
end
- create_table :guids, :force => true do |t|
- t.column :key, :string
- end
-
- create_table :integer_limits, :force => true do |t|
- t.integer :"c_int_without_limit"
- (1..8).each do |i|
- t.integer :"c_int_#{i}", :limit => i
- end
- end
-
# NOTE - the following 4 tables are used by models that have :inverse_of options on the associations
create_table :men, :force => true do |t|
t.string :name
@@ -647,7 +649,6 @@ def create_table(*args, &block)
t.string :name
end
-
except 'SQLite' do
# fk_test_has_fk should be before fk_test_has_pk
create_table :fk_test_has_fk, :force => true do |t|

0 comments on commit a031fc5

Please sign in to comment.
Something went wrong with that request. Please try again.