aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/mysql_specific_schema.rb11
-rw-r--r--activerecord/test/schema/postgresql_specific_schema.rb2
-rw-r--r--activerecord/test/schema/schema.rb157
3 files changed, 122 insertions, 48 deletions
diff --git a/activerecord/test/schema/mysql_specific_schema.rb b/activerecord/test/schema/mysql_specific_schema.rb
index c78d99f4af..30e1c5a167 100644
--- a/activerecord/test/schema/mysql_specific_schema.rb
+++ b/activerecord/test/schema/mysql_specific_schema.rb
@@ -21,4 +21,15 @@ BEGIN
END
SQL
+ ActiveRecord::Base.connection.execute <<-SQL
+DROP PROCEDURE IF EXISTS topics;
+SQL
+
+ ActiveRecord::Base.connection.execute <<-SQL
+CREATE PROCEDURE topics() SQL SECURITY INVOKER
+BEGIN
+ select * from topics limit 1;
+END
+SQL
+
end
diff --git a/activerecord/test/schema/postgresql_specific_schema.rb b/activerecord/test/schema/postgresql_specific_schema.rb
index 065d8cfe98..f38f4f3b44 100644
--- a/activerecord/test/schema/postgresql_specific_schema.rb
+++ b/activerecord/test/schema/postgresql_specific_schema.rb
@@ -100,7 +100,7 @@ _SQL
obj_id OID
);
_SQL
-
+
execute <<_SQL
CREATE TABLE postgresql_timestamp_with_zones (
id SERIAL PRIMARY KEY,
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index fc3810f82b..362475de36 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -18,8 +18,13 @@ ActiveRecord::Schema.define do
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
@@ -44,6 +49,8 @@ ActiveRecord::Schema.define do
t.string :name, :null => false
t.integer :author_address_id
t.integer :author_address_extra_id
+ t.string :organization_id
+ t.string :owned_essay_id
end
create_table :author_addresses, :force => true do |t|
@@ -54,7 +61,6 @@ ActiveRecord::Schema.define do
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
@@ -71,13 +77,19 @@ ActiveRecord::Schema.define do
end
create_table :books, :force => true do |t|
+ t.integer :author_id
t.column :name, :string
end
- create_table :booleantests, :force => true do |t|
+ create_table :booleans, :force => true do |t|
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
@@ -101,8 +113,10 @@ ActiveRecord::Schema.define do
create_table :categorizations, :force => true do |t|
t.column :category_id, :integer
+ t.string :named_category_name
t.column :post_id, :integer
t.column :author_id, :integer
+ t.column :special, :boolean
end
create_table :citations, :force => true do |t|
@@ -112,6 +126,7 @@ ActiveRecord::Schema.define do
create_table :clubs, :force => true do |t|
t.string :name
+ t.integer :category_id
end
create_table :collections, :force => true do |t|
@@ -132,6 +147,7 @@ ActiveRecord::Schema.define do
t.text :body, :null => false
end
t.string :type
+ t.integer :taggings_count, :default => 0
end
create_table :companies, :force => true do |t|
@@ -142,6 +158,7 @@ ActiveRecord::Schema.define do
t.string :name
t.integer :client_of
t.integer :rating, :default => 1
+ t.integer :account_id
end
add_index :companies, [:firm_id, :type, :rating, :ruby_type], :name => "company_index"
@@ -164,7 +181,7 @@ ActiveRecord::Schema.define do
t.string :address_country
t.string :gps_location
end
-
+
create_table :dashboards, :force => true, :id => false do |t|
t.string :dashboard_id
t.string :name
@@ -203,28 +220,32 @@ ActiveRecord::Schema.define do
t.string :name
t.string :writer_id
t.string :writer_type
+ t.string :category_id
+ t.string :author_id
end
create_table :events, :force => true do |t|
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
+ create_table :cold_jokes, :force => true do |t|
+ t.string :name
+ end
+
create_table :goofy_string_id, :force => true, :id => false do |t|
t.string :id, :null => false
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, :integer
+ create_table :guids, :force => true do |t|
+ t.column :key, :string
end
create_table :inept_wizards, :force => true do |t|
@@ -233,6 +254,26 @@ ActiveRecord::Schema.define do
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
@@ -248,6 +289,15 @@ ActiveRecord::Schema.define do
t.integer :version, :null => false, :default => 0
end
+ create_table :lessons, :force => true do |t|
+ t.string :name
+ end
+
+ create_table :lessons_students, :id => false, :force => true do |t|
+ t.references :lesson
+ t.references :student
+ end
+
create_table :line_items, :force => true do |t|
t.integer :invoice_id
t.integer :amount
@@ -289,13 +339,6 @@ ActiveRecord::Schema.define do
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
@@ -334,8 +377,8 @@ ActiveRecord::Schema.define do
t.decimal :my_house_population, :precision => 2, :scale => 0
t.decimal :decimal_number_with_default, :precision => 3, :scale => 2, :default => 2.78
t.float :temperature
- # Oracle supports precision up to 38
- if current_adapter?(:OracleAdapter)
+ # Oracle/SQLServer supports precision up to 38
+ if current_adapter?(:OracleAdapter,:SQLServerAdapter)
t.decimal :atoms_in_universe, :precision => 38, :scale => 0
else
t.decimal :atoms_in_universe, :precision => 55, :scale => 0
@@ -356,9 +399,9 @@ ActiveRecord::Schema.define do
t.string :name
t.column :updated_at, :datetime
t.column :happy_at, :datetime
+ t.string :essay_id
end
-
create_table :paint_colors, :force => true do |t|
t.integer :non_poly_one_id
end
@@ -393,6 +436,8 @@ ActiveRecord::Schema.define do
t.string :gender, :limit => 1
t.references :number1_fan
t.integer :lock_version, :null => false, :default => 0
+ t.string :comments
+ t.timestamps
end
create_table :pets, :primary_key => :pet_id ,:force => true do |t|
@@ -421,6 +466,11 @@ ActiveRecord::Schema.define do
t.string :type
t.integer :comments_count, :default => 0
t.integer :taggings_count, :default => 0
+ t.integer :taggings_with_delete_all_count, :default => 0
+ t.integer :taggings_with_destroy_count, :default => 0
+ t.integer :tags_count, :default => 0
+ t.integer :tags_with_destroy_count, :default => 0
+ t.integer :tags_with_nullify_count, :default => 0
end
create_table :price_estimates, :force => true do |t|
@@ -439,12 +489,24 @@ ActiveRecord::Schema.define do
t.string :type
end
+ create_table :ratings, :force => true do |t|
+ t.integer :comment_id
+ t.integer :value
+ end
+
create_table :readers, :force => true do |t|
t.integer :post_id, :null => false
t.integer :person_id, :null => false
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
@@ -465,7 +527,7 @@ ActiveRecord::Schema.define do
t.string :name
t.integer :ship_id
end
-
+
create_table :speedometers, :force => true, :id => false do |t|
t.string :speedometer_id
t.string :name
@@ -478,6 +540,10 @@ ActiveRecord::Schema.define do
t.string :sponsorable_type
end
+ create_table :students, :force => true do |t|
+ t.string :name
+ end
+
create_table :subscribers, :force => true, :id => false do |t|
t.string :nick, :null => false
t.string :name
@@ -489,6 +555,19 @@ ActiveRecord::Schema.define do
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
+ t.string :comment
+ end
+
create_table :tasks, :force => true do |t|
t.datetime :starting
t.datetime :ending
@@ -514,18 +593,7 @@ ActiveRecord::Schema.define do
t.string :parent_title
t.string :type
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
+ t.timestamps
end
create_table :toys, :primary_key => :toy_id ,:force => true do |t|
@@ -547,6 +615,10 @@ ActiveRecord::Schema.define do
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
@@ -564,17 +636,6 @@ ActiveRecord::Schema.define do
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
@@ -629,7 +690,9 @@ ActiveRecord::Schema.define do
t.integer :molecule_id
t.string :name
end
-
+ create_table :weirds, :force => true do |t|
+ t.string 'a$b'
+ end
except 'SQLite' do
# fk_test_has_fk should be before fk_test_has_pk