diff options
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r-- | activerecord/test/schema/mysql2_specific_schema.rb | 16 | ||||
-rw-r--r-- | activerecord/test/schema/postgresql_specific_schema.rb | 32 | ||||
-rw-r--r-- | activerecord/test/schema/schema.rb | 31 |
3 files changed, 42 insertions, 37 deletions
diff --git a/activerecord/test/schema/mysql2_specific_schema.rb b/activerecord/test/schema/mysql2_specific_schema.rb index 5a49b38457..9a203a7293 100644 --- a/activerecord/test/schema/mysql2_specific_schema.rb +++ b/activerecord/test/schema/mysql2_specific_schema.rb @@ -1,8 +1,8 @@ ActiveRecord::Schema.define do - if ActiveRecord::Base.connection.version >= '5.6.0' + if ActiveRecord::Base.connection.version >= "5.6.0" create_table :datetime_defaults, force: true do |t| - t.datetime :modified_datetime, default: -> { 'CURRENT_TIMESTAMP' } + t.datetime :modified_datetime, default: -> { "CURRENT_TIMESTAMP" } end end @@ -21,18 +21,18 @@ ActiveRecord::Schema.define do t.index :var_binary end - create_table :key_tests, force: true, options: 'ENGINE=MyISAM' do |t| + create_table :key_tests, force: true, options: "ENGINE=MyISAM" do |t| t.string :awesome t.string :pizza t.string :snacks - t.index :awesome, type: :fulltext, name: 'index_key_tests_on_awesome' - t.index :pizza, using: :btree, name: 'index_key_tests_on_pizza' - t.index :snacks, name: 'index_key_tests_on_snack' + t.index :awesome, type: :fulltext, name: "index_key_tests_on_awesome" + t.index :pizza, using: :btree, name: "index_key_tests_on_pizza" + t.index :snacks, name: "index_key_tests_on_snack" end create_table :collation_tests, id: false, force: true do |t| - t.string :string_cs_column, limit: 1, collation: 'utf8_bin' - t.string :string_ci_column, limit: 1, collation: 'utf8_general_ci' + t.string :string_cs_column, limit: 1, collation: "utf8_bin" + t.string :string_ci_column, limit: 1, collation: "utf8_general_ci" t.binary :binary_column, limit: 1 end diff --git a/activerecord/test/schema/postgresql_specific_schema.rb b/activerecord/test/schema/postgresql_specific_schema.rb index 24713f722a..f00b858ea6 100644 --- a/activerecord/test/schema/postgresql_specific_schema.rb +++ b/activerecord/test/schema/postgresql_specific_schema.rb @@ -1,6 +1,6 @@ ActiveRecord::Schema.define do - enable_extension!('uuid-ossp', ActiveRecord::Base.connection) + enable_extension!("uuid-ossp", ActiveRecord::Base.connection) create_table :uuid_parents, id: :uuid, force: true do |t| t.string :name @@ -12,16 +12,16 @@ ActiveRecord::Schema.define do end create_table :defaults, force: true do |t| - t.date :modified_date, default: -> { 'CURRENT_DATE' } - t.date :modified_date_function, default: -> { 'now()' } - t.date :fixed_date, default: '2004-01-01' - t.datetime :modified_time, default: -> { 'CURRENT_TIMESTAMP' } - t.datetime :modified_time_function, default: -> { 'now()' } - t.datetime :fixed_time, default: '2004-01-01 00:00:00.000000-00' - t.column :char1, 'char(1)', default: 'Y' - t.string :char2, limit: 50, default: 'a varchar field' - t.text :char3, default: 'a text field' - t.bigint :bigint_default, default: -> { '0::bigint' } + t.date :modified_date, default: -> { "CURRENT_DATE" } + t.date :modified_date_function, default: -> { "now()" } + t.date :fixed_date, default: "2004-01-01" + t.datetime :modified_time, default: -> { "CURRENT_TIMESTAMP" } + t.datetime :modified_time_function, default: -> { "now()" } + t.datetime :fixed_time, default: "2004-01-01 00:00:00.000000-00" + t.column :char1, "char(1)", default: "Y" + t.string :char2, limit: 50, default: "a varchar field" + t.text :char3, default: "a text field" + t.bigint :bigint_default, default: -> { "0::bigint" } t.text :multiline_default, default: '--- [] ' @@ -32,12 +32,12 @@ ActiveRecord::Schema.define do drop_table table_name, if_exists: true end - execute 'DROP SEQUENCE IF EXISTS companies_nonstd_seq CASCADE' - execute 'CREATE SEQUENCE companies_nonstd_seq START 101 OWNED BY companies.id' + execute "DROP SEQUENCE IF EXISTS companies_nonstd_seq CASCADE" + execute "CREATE SEQUENCE companies_nonstd_seq START 101 OWNED BY companies.id" execute "ALTER TABLE companies ALTER COLUMN id SET DEFAULT nextval('companies_nonstd_seq')" - execute 'DROP SEQUENCE IF EXISTS companies_id_seq' + execute "DROP SEQUENCE IF EXISTS companies_id_seq" - execute 'DROP FUNCTION IF EXISTS partitioned_insert_trigger()' + execute "DROP FUNCTION IF EXISTS partitioned_insert_trigger()" %w(accounts_id_seq developers_id_seq projects_id_seq topics_id_seq customers_id_seq orders_id_seq).each do |seq_name| execute "SELECT setval('#{seq_name}', 100)" @@ -88,7 +88,7 @@ _SQL FOR EACH ROW EXECUTE PROCEDURE partitioned_insert_trigger(); _SQL rescue ActiveRecord::StatementInvalid => e - if e.message =~ /language "plpgsql" does not exist/ + if e.message.include?('language "plpgsql" does not exist') execute "CREATE LANGUAGE 'plpgsql';" retry else diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index 2f2993ce18..9997ddee77 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,7 @@ 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 :cover, :string, default: "hard" end create_table :booleans, force: true do |t| @@ -198,8 +198,8 @@ ActiveRecord::Schema.define do t.string :description, default: "" t.index [:firm_id, :type, :rating], name: "company_index" 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 +298,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 +390,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 @@ -889,12 +894,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 @@ -929,11 +934,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 @@ -954,9 +959,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| @@ -1010,7 +1015,7 @@ ActiveRecord::Schema.define do 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| |