aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema/schema.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/schema/schema.rb')
-rw-r--r--activerecord/test/schema/schema.rb51
1 files changed, 30 insertions, 21 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index 628a59c2e3..983ac076a9 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -21,7 +21,7 @@ ActiveRecord::Schema.define do
t.string :settings, null: true, limit: 1024
# MySQL does not allow default values for blobs. Fake it out with a
# big varchar below.
- t.string :preferences, null: true, default: '', limit: 1024
+ t.string :preferences, null: true, default: "", limit: 1024
t.string :json_data, null: true, limit: 1024
t.string :json_data_empty, null: true, default: "", limit: 1024
t.text :params
@@ -98,7 +98,8 @@ ActiveRecord::Schema.define do
t.column :author_visibility, :integer, default: 0
t.column :illustrator_visibility, :integer, default: 0
t.column :font_size, :integer, default: 0
- t.column :cover, :string, default: 'hard'
+ t.column :difficulty, :integer, default: 0
+ t.column :cover, :string, default: "hard"
end
create_table :booleans, force: true do |t|
@@ -196,10 +197,10 @@ ActiveRecord::Schema.define do
t.integer :rating, default: 1
t.integer :account_id
t.string :description, default: ""
- t.index [:firm_id, :type, :rating], name: "company_index"
+ t.index [:firm_id, :type, :rating], name: "company_index", length: { type: 10 }, order: { rating: :desc }
t.index [:firm_id, :type], name: "company_partial_index", where: "rating > 10"
- t.index :name, name: 'company_name_index', using: :btree
- t.index 'lower(name)', name: "company_expression_index" if supports_expression_index?
+ t.index :name, name: "company_name_index", using: :btree
+ t.index "lower(name)", name: "company_expression_index" if supports_expression_index?
end
create_table :content, force: true do |t|
@@ -298,7 +299,7 @@ ActiveRecord::Schema.define do
create_table :edges, force: true, id: false do |t|
t.column :source_id, :integer, null: false
t.column :sink_id, :integer, null: false
- t.index [:source_id, :sink_id], unique: true, name: 'unique_edge_index'
+ t.index [:source_id, :sink_id], unique: true, name: "unique_edge_index"
end
create_table :engines, force: true do |t|
@@ -390,6 +391,11 @@ ActiveRecord::Schema.define do
t.integer :ideal_reference_id
end
+ create_table :jobs_pool, force: true, id: false do |t|
+ t.references :job, null: false, index: true
+ t.references :user, null: false, index: true
+ end
+
create_table :keyboards, force: true, id: false do |t|
t.primary_key :key_number
t.string :name
@@ -409,6 +415,14 @@ ActiveRecord::Schema.define do
t.references :student
end
+ create_table :students, force: true do |t|
+ t.string :name
+ t.boolean :active
+ t.integer :college_id
+ end
+
+ add_foreign_key :lessons_students, :students, on_delete: :cascade
+
create_table :lint_models, force: true
create_table :line_items, force: true do |t|
@@ -422,10 +436,12 @@ ActiveRecord::Schema.define do
end
create_table :lock_without_defaults, force: true do |t|
+ t.column :title, :string
t.column :lock_version, :integer
end
create_table :lock_without_defaults_cust, force: true do |t|
+ t.column :title, :string
t.column :custom_lock_version, :integer
end
@@ -777,12 +793,6 @@ ActiveRecord::Schema.define do
t.integer :lock_version, null: false, default: 0
end
- create_table :students, force: true do |t|
- t.string :name
- t.boolean :active
- t.integer :college_id
- end
-
create_table :subscribers, force: true, id: false do |t|
t.string :nick, null: false
t.string :name
@@ -887,12 +897,12 @@ ActiveRecord::Schema.define do
t.column :label, :string
end
- create_table 'warehouse-things', force: true do |t|
+ create_table "warehouse-things", force: true do |t|
t.integer :value
end
[:circles, :squares, :triangles, :non_poly_ones, :non_poly_twos].each do |t|
- create_table(t, force: true) { }
+ create_table(t, force: true) {}
end
# NOTE - the following 4 tables are used by models that have :inverse_of options on the associations
@@ -927,11 +937,11 @@ ActiveRecord::Schema.define do
t.string :title
end
- create_table :countries, force: true, id: false, primary_key: 'country_id' do |t|
+ create_table :countries, force: true, id: false, primary_key: "country_id" do |t|
t.string :country_id
t.string :name
end
- create_table :treaties, force: true, id: false, primary_key: 'treaty_id' do |t|
+ create_table :treaties, force: true, id: false, primary_key: "treaty_id" do |t|
t.string :treaty_id
t.string :name
end
@@ -952,9 +962,9 @@ ActiveRecord::Schema.define do
t.string :name
end
create_table :weirds, force: true do |t|
- t.string 'a$b'
- t.string 'なまえ'
- t.string 'from'
+ t.string "a$b"
+ t.string "なまえ"
+ t.string "from"
end
create_table :nodes, force: true do |t|
@@ -1002,14 +1012,13 @@ ActiveRecord::Schema.define do
end
add_foreign_key :fk_test_has_fk, :fk_test_has_pk, column: "fk_id", name: "fk_name", primary_key: "pk_id"
- add_foreign_key :lessons_students, :students
end
create_table :overloaded_types, force: true do |t|
t.float :overloaded_float, default: 500
t.float :unoverloaded_float
t.string :overloaded_string_with_limit, limit: 255
- t.string :string_with_default, default: 'the original default'
+ t.string :string_with_default, default: "the original default"
end
create_table :users, force: true do |t|