From f8042906f3f15ab5016333476ec51cb2bdd34b72 Mon Sep 17 00:00:00 2001 From: Kosuke Tanabe Date: Sat, 13 Jul 2019 17:01:31 +0900 Subject: [PATCH] update dummy migration files --- app/models/user_group_has_checkout_type.rb | 30 +++++------ bin/rails | 8 +-- enju_circulation.gemspec | 2 +- spec/dummy/db/migrate/113_create_events.rb | 6 +-- ...0081028093607_create_event_import_files.rb | 6 +-- .../20090519203307_create_participates.rb | 6 +-- ...00925074639_create_event_import_results.rb | 4 +- ...default_library_id_to_event_import_file.rb | 2 +- ...0140812152348_create_event_export_files.rb | 2 +- ..._event_category_id_to_event_import_file.rb | 2 +- .../migrate/20151128142913_create_places.rb | 14 +++++ .../20151201163718_add_place_id_to_event.rb | 5 ++ ...recent_to_event_import_file_transitions.rb | 9 ++++ ...recent_to_event_export_file_transitions.rb | 9 ++++ ...ecent_for_event_import_file_transitions.rb | 13 +++++ ...ecent_for_event_export_file_transitions.rb | 13 +++++ ..._to_events_referencing_event_categories.rb | 5 ++ ..._add_display_name_translations_to_event.rb | 6 +++ ...splay_name_translations_to_carrier_type.rb | 21 ++++++++ spec/dummy/db/schema.rb | 37 +++++++++++++- spec/fixtures/carrier_types.yml | 31 +++++------ spec/fixtures/content_types.yml | 51 ++++++++----------- spec/fixtures/event_categories.yml | 46 ++++++++--------- spec/fixtures/frequencies.yml | 42 +++++++-------- .../user_group_has_checkout_types.yml | 28 +++++----- .../user_group_has_checkout_type_spec.rb | 30 +++++------ 26 files changed, 267 insertions(+), 161 deletions(-) create mode 100644 spec/dummy/db/migrate/20151128142913_create_places.rb create mode 100644 spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb create mode 100644 spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb create mode 100644 spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb create mode 100644 spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb create mode 100644 spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb create mode 100644 spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb create mode 100644 spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb create mode 100644 spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb diff --git a/app/models/user_group_has_checkout_type.rb b/app/models/user_group_has_checkout_type.rb index e345cc22..59abd2cd 100644 --- a/app/models/user_group_has_checkout_type.rb +++ b/app/models/user_group_has_checkout_type.rb @@ -68,19 +68,19 @@ def self.update_current_checkout_count # # Table name: user_group_has_checkout_types # -# id :integer not null, primary key -# user_group_id :integer not null -# checkout_type_id :integer not null -# checkout_limit :integer default(0), not null -# checkout_period :integer default(0), not null -# checkout_renewal_limit :integer default(0), not null -# reservation_limit :integer default(0), not null -# reservation_expired_period :integer default(7), not null -# set_due_date_before_closing_day :boolean default(FALSE), not null -# fixed_due_date :datetime -# note :text -# position :integer -# created_at :datetime -# updated_at :datetime -# current_checkout_count :integer +# id :integer not null, primary key +# user_group_id :integer not null +# checkout_type_id :integer not null +# checkout_limit :integer default(0), not null +# checkout_period :integer default(0), not null +# checkout_renewal_limit :integer default(0), not null +# reservation_limit :integer default(0), not null +# reservation_expired_period :integer default(7), not null +# set_due_date_after_closing_day :boolean default(FALSE), not null +# fixed_due_date :datetime +# note :text +# position :integer +# created_at :datetime +# updated_at :datetime +# current_checkout_count :integer # diff --git a/bin/rails b/bin/rails index 7834751b..193a3536 100755 --- a/bin/rails +++ b/bin/rails @@ -2,12 +2,12 @@ # This command will automatically be run when you run "rails" with Rails gems # installed from the root of your application. -ENGINE_ROOT = File.expand_path('..', __dir__) -ENGINE_PATH = File.expand_path('../lib/enju_circulation/engine', __dir__) -APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__) +ENGINE_ROOT = File.expand_path('../..', __FILE__) +ENGINE_PATH = File.expand_path('../../lib/enju_circulation/engine', __FILE__) +APP_PATH = File.expand_path('../../spec/dummy/config/application', __FILE__) # Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) require 'rails/all' diff --git a/enju_circulation.gemspec b/enju_circulation.gemspec index 24b144ae..f83e49db 100644 --- a/enju_circulation.gemspec +++ b/enju_circulation.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |s| s.add_development_dependency "rspec-activemodel-mocks" s.add_development_dependency "rspec-rails", "~> 3.8" s.add_development_dependency "simplecov" - s.add_development_dependency "sunspot_solr", "~> 2.4" + s.add_development_dependency "sunspot_solr", "~> 2.5" s.add_development_dependency "selenium-webdriver" s.add_development_dependency "puma" s.add_development_dependency "annotate" diff --git a/spec/dummy/db/migrate/113_create_events.rb b/spec/dummy/db/migrate/113_create_events.rb index 9b8426d0..cfabd453 100644 --- a/spec/dummy/db/migrate/113_create_events.rb +++ b/spec/dummy/db/migrate/113_create_events.rb @@ -1,8 +1,8 @@ class CreateEvents < ActiveRecord::Migration[4.2] def self.up create_table :events do |t| - t.integer :library_id, null: false - t.integer :event_category_id, null: false + t.references :library, index: true, null: false + t.references :event_category, index: true, null: false t.string :name t.text :note t.datetime :start_at @@ -13,8 +13,6 @@ def self.up t.timestamps end - add_index :events, :library_id - add_index :events, :event_category_id end def self.down diff --git a/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb b/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb index 7255a11f..5002331f 100644 --- a/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +++ b/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb @@ -1,10 +1,10 @@ class CreateEventImportFiles < ActiveRecord::Migration[4.2] def self.up create_table :event_import_files do |t| - t.integer :parent_id + t.references :parent, index: true t.string :content_type t.integer :size - t.integer :user_id + t.references :user, index: true t.text :note t.datetime :imported_at t.string :event_import_file_name @@ -15,8 +15,6 @@ def self.up t.timestamps end - add_index :event_import_files, :parent_id - add_index :event_import_files, :user_id end def self.down diff --git a/spec/dummy/db/migrate/20090519203307_create_participates.rb b/spec/dummy/db/migrate/20090519203307_create_participates.rb index f2203d9e..6c6e6536 100644 --- a/spec/dummy/db/migrate/20090519203307_create_participates.rb +++ b/spec/dummy/db/migrate/20090519203307_create_participates.rb @@ -1,14 +1,12 @@ class CreateParticipates < ActiveRecord::Migration[4.2] def self.up create_table :participates do |t| - t.integer :agent_id, null: false - t.integer :event_id, null: false + t.references :agent, index: true, null: false + t.references :event, index: true, null: false t.integer :position t.timestamps end - add_index :participates, :event_id - add_index :participates, :agent_id end def self.down diff --git a/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb b/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb index b5c37c6d..1240836e 100644 --- a/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +++ b/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb @@ -1,8 +1,8 @@ class CreateEventImportResults < ActiveRecord::Migration[4.2] def self.up create_table :event_import_results do |t| - t.integer :event_import_file_id - t.integer :event_id + t.references :event_import_file + t.references :event t.text :body t.timestamps diff --git a/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb b/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb index ead1e141..cd2064ce 100644 --- a/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +++ b/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb @@ -1,5 +1,5 @@ class AddDefaultLibraryIdToEventImportFile < ActiveRecord::Migration[4.2] def change - add_column :event_import_files, :default_library_id, :integer + add_reference :event_import_files, :default_library end end diff --git a/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb b/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb index 4cfacc2e..2bdc6dbd 100644 --- a/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +++ b/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb @@ -1,7 +1,7 @@ class CreateEventExportFiles < ActiveRecord::Migration[4.2] def change create_table :event_export_files do |t| - t.integer :user_id + t.references :user, index: true t.attachment :event_export t.datetime :executed_at diff --git a/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb b/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb index 4fa07934..0a987134 100644 --- a/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +++ b/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb @@ -1,5 +1,5 @@ class AddDefaultEventCategoryIdToEventImportFile < ActiveRecord::Migration[4.2] def change - add_column :event_import_files, :default_event_category_id, :integer + add_reference :event_import_files, :default_event_category end end diff --git a/spec/dummy/db/migrate/20151128142913_create_places.rb b/spec/dummy/db/migrate/20151128142913_create_places.rb new file mode 100644 index 00000000..a6dae61f --- /dev/null +++ b/spec/dummy/db/migrate/20151128142913_create_places.rb @@ -0,0 +1,14 @@ +class CreatePlaces < ActiveRecord::Migration[4.2] + def change + create_table :places do |t| + t.string :term + t.text :city + t.references :country, index: true + t.float :latitude + t.float :longitude + + t.timestamps null: false + end + add_index :places, :term + end +end diff --git a/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb b/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb new file mode 100644 index 00000000..bc49babe --- /dev/null +++ b/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb @@ -0,0 +1,5 @@ +class AddPlaceIdToEvent < ActiveRecord::Migration[4.2] + def change + add_reference :events, :place, index: true + end +end diff --git a/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb b/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb new file mode 100644 index 00000000..f0bc9d75 --- /dev/null +++ b/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb @@ -0,0 +1,9 @@ +class AddMostRecentToEventImportFileTransitions < ActiveRecord::Migration[4.2] + def up + add_column :event_import_file_transitions, :most_recent, :boolean, null: true + end + + def down + remove_column :event_import_file_transitions, :most_recent + end +end diff --git a/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb b/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb new file mode 100644 index 00000000..6d544115 --- /dev/null +++ b/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb @@ -0,0 +1,9 @@ +class AddMostRecentToEventExportFileTransitions < ActiveRecord::Migration[4.2] + def up + add_column :event_export_file_transitions, :most_recent, :boolean, null: true + end + + def down + remove_column :event_export_file_transitions, :most_recent + end +end diff --git a/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb b/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb new file mode 100644 index 00000000..aea1c2d2 --- /dev/null +++ b/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb @@ -0,0 +1,13 @@ +class AddConstraintsToMostRecentForEventImportFileTransitions < ActiveRecord::Migration[4.2] + disable_ddl_transaction! + + def up + add_index :event_import_file_transitions, [:event_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_event_import_file_transitions_parent_most_recent" #, algorithm: :concurrently + change_column_null :event_import_file_transitions, :most_recent, false + end + + def down + remove_index :event_import_file_transitions, name: "index_event_import_file_transitions_parent_most_recent" + change_column_null :event_import_file_transitions, :most_recent, true + end +end diff --git a/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb b/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb new file mode 100644 index 00000000..a4f0fad5 --- /dev/null +++ b/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb @@ -0,0 +1,13 @@ +class AddConstraintsToMostRecentForEventExportFileTransitions < ActiveRecord::Migration[4.2] + disable_ddl_transaction! + + def up + add_index :event_export_file_transitions, [:event_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_event_export_file_transitions_parent_most_recent" #, algorithm: :concurrently + change_column_null :event_export_file_transitions, :most_recent, false + end + + def down + remove_index :event_export_file_transitions, name: "index_event_export_file_transitions_parent_most_recent" + change_column_null :event_export_file_transitions, :most_recent, true + end +end diff --git a/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb b/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb new file mode 100644 index 00000000..01129a27 --- /dev/null +++ b/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb @@ -0,0 +1,5 @@ +class AddForeignKeyToEventsReferencingEventCategories < ActiveRecord::Migration[5.1] + def change + add_foreign_key :events, :event_categories + end +end diff --git a/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb b/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb new file mode 100644 index 00000000..985cbd52 --- /dev/null +++ b/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb @@ -0,0 +1,6 @@ +class AddDisplayNameTranslationsToEvent < ActiveRecord::Migration[5.2] + def change + add_column :event_categories, :display_name_translations, :jsonb, default: {}, null: false + add_column :events, :display_name_translations, :jsonb, default: {}, null: false + end +end diff --git a/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb b/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb new file mode 100644 index 00000000..b1142250 --- /dev/null +++ b/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb @@ -0,0 +1,21 @@ +class AddDisplayNameTranslationsToCarrierType < ActiveRecord::Migration[5.2] + def change + [ + :agent_relationship_types, + :agent_types, + :carrier_types, + :content_types, + :create_types, + :form_of_works, + :frequencies, + :languages, + :licenses, + :manifestation_relationship_types, + :medium_of_performances, + :produce_types, + :realize_types + ].each do |table| + add_column table, :display_name_translations, :jsonb, default: {}, null: false + end + end +end diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index 85402470..20067d04 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_07_06_052525) do +ActiveRecord::Schema.define(version: 2019_07_12_163038) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -91,6 +91,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "agent_relationships", id: :serial, force: :cascade do |t| @@ -111,6 +112,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "agents", id: :serial, force: :cascade do |t| @@ -223,6 +225,7 @@ t.string "attachment_content_type" t.bigint "attachment_file_size" t.datetime "attachment_updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "checked_items", id: :serial, force: :cascade do |t| @@ -331,6 +334,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "countries", id: :serial, force: :cascade do |t| @@ -354,6 +358,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "creates", id: :serial, force: :cascade do |t| @@ -394,6 +399,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "event_export_file_transitions", id: :serial, force: :cascade do |t| @@ -403,6 +409,8 @@ t.integer "event_export_file_id" t.datetime "created_at" t.datetime "updated_at" + t.boolean "most_recent", null: false + t.index ["event_export_file_id", "most_recent"], name: "index_event_export_file_transitions_parent_most_recent", unique: true, where: "most_recent" t.index ["event_export_file_id"], name: "index_event_export_file_transitions_on_file_id" t.index ["sort_key", "event_export_file_id"], name: "index_event_export_file_transitions_on_sort_key_and_file_id", unique: true end @@ -416,6 +424,7 @@ t.datetime "executed_at" t.datetime "created_at" t.datetime "updated_at" + t.index ["user_id"], name: "index_event_export_files_on_user_id" end create_table "event_import_file_transitions", id: :serial, force: :cascade do |t| @@ -425,6 +434,8 @@ t.integer "event_import_file_id" t.datetime "created_at" t.datetime "updated_at" + t.boolean "most_recent", null: false + t.index ["event_import_file_id", "most_recent"], name: "index_event_import_file_transitions_parent_most_recent", unique: true, where: "most_recent" t.index ["event_import_file_id"], name: "index_event_import_file_transitions_on_event_import_file_id" t.index ["sort_key", "event_import_file_id"], name: "index_event_import_file_transitions_on_sort_key_and_file_id", unique: true end @@ -472,8 +483,11 @@ t.text "display_name" t.datetime "created_at" t.datetime "updated_at" + t.integer "place_id" + t.jsonb "display_name_translations", default: {}, null: false t.index ["event_category_id"], name: "index_events_on_event_category_id" t.index ["library_id"], name: "index_events_on_library_id" + t.index ["place_id"], name: "index_events_on_place_id" end create_table "exemplifies", id: :serial, force: :cascade do |t| @@ -493,6 +507,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "frequencies", id: :serial, force: :cascade do |t| @@ -502,6 +517,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "identifier_types", id: :serial, force: :cascade do |t| @@ -600,6 +616,7 @@ t.string "iso_639_3" t.text "note" t.integer "position" + t.jsonb "display_name_translations", default: {}, null: false t.index ["iso_639_1"], name: "index_languages_on_iso_639_1" t.index ["iso_639_2"], name: "index_languages_on_iso_639_2" t.index ["iso_639_3"], name: "index_languages_on_iso_639_3" @@ -691,6 +708,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "manifestation_checkout_stat_transitions", id: :serial, force: :cascade do |t| @@ -725,6 +743,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "manifestation_relationships", id: :serial, force: :cascade do |t| @@ -835,6 +854,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "message_request_transitions", id: :serial, force: :cascade do |t| @@ -942,6 +962,18 @@ t.index ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type" end + create_table "places", id: :serial, force: :cascade do |t| + t.string "term" + t.text "city" + t.integer "country_id" + t.float "latitude" + t.float "longitude" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["country_id"], name: "index_places_on_country_id" + t.index ["term"], name: "index_places_on_term" + end + create_table "produce_types", id: :serial, force: :cascade do |t| t.string "name" t.text "display_name" @@ -949,6 +981,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "produces", id: :serial, force: :cascade do |t| @@ -993,6 +1026,7 @@ t.integer "position" t.datetime "created_at" t.datetime "updated_at" + t.jsonb "display_name_translations", default: {}, null: false end create_table "realizes", id: :serial, force: :cascade do |t| @@ -1503,6 +1537,7 @@ add_foreign_key "demands", "items" add_foreign_key "demands", "messages" add_foreign_key "demands", "users" + add_foreign_key "events", "event_categories" add_foreign_key "item_has_use_restrictions", "items" add_foreign_key "item_has_use_restrictions", "use_restrictions" add_foreign_key "items", "manifestations" diff --git a/spec/fixtures/carrier_types.yml b/spec/fixtures/carrier_types.yml index 76044349..9eb07355 100644 --- a/spec/fixtures/carrier_types.yml +++ b/spec/fixtures/carrier_types.yml @@ -1,7 +1,7 @@ --- carrier_type_00001: name: volume - display_name: Volume + display_name_translations: {"en": "Volume", "ja": "Volume"} updated_at: 2007-11-20 16:04:29.853828 +09:00 id: 1 note: !binary | @@ -11,7 +11,7 @@ carrier_type_00001: position: 1 carrier_type_00002: name: audio_disc - display_name: Audio disc + display_name_translations: {"en": "Audio disc", "ja": "Audio disc"} updated_at: 2007-12-19 01:45:26.040674 +09:00 id: 2 note: "\xE9\x9F\xB3\xE6\xA5\xBDCD\xE3\x81\xA7\xE3\x81\x99\xE3\x80\x82" @@ -19,7 +19,7 @@ carrier_type_00002: position: 2 carrier_type_00003: name: videodisc - display_name: Video disc + display_name_translations: {"en": "Video disc", "ja": "Video disc"} updated_at: 2007-12-23 04:24:23.151410 +09:00 id: 3 note: "DVD\xE3\x81\xA7\xE3\x81\x99\xE3\x80\x82" @@ -27,7 +27,7 @@ carrier_type_00003: position: 3 carrier_type_00004: name: online_resource - display_name: online_resource + display_name_translations: {"en": "online_resource", "ja": "online_resource"} updated_at: 2007-12-24 01:30:50.637433 +09:00 id: 4 note: !binary | @@ -40,15 +40,16 @@ carrier_type_00004: # # Table name: carrier_types # -# id :integer not null, primary key -# name :string not null -# display_name :text -# note :text -# position :integer -# created_at :datetime -# updated_at :datetime -# attachment_file_name :string -# attachment_content_type :string -# attachment_file_size :integer -# attachment_updated_at :datetime +# id :integer not null, primary key +# name :string not null +# display_name :text +# note :text +# position :integer +# created_at :datetime +# updated_at :datetime +# attachment_file_name :string +# attachment_content_type :string +# attachment_file_size :bigint +# attachment_updated_at :datetime +# display_name_translations :jsonb not null # diff --git a/spec/fixtures/content_types.yml b/spec/fixtures/content_types.yml index 011a2b9d..8e5ad1a0 100644 --- a/spec/fixtures/content_types.yml +++ b/spec/fixtures/content_types.yml @@ -2,85 +2,73 @@ content_type_00001: id: 1 name: text - display_name: "en: text\r\n\ - ja: 文字" + display_name_translations: {"en": "text", "ja": "文字"} note: position: 1 content_type_00002: id: 2 name: performed_music - display_name: "en: Performed music\r\n\ - ja: 音楽" + display_name_translations: {"en": "Performed music", "ja": "音楽"} note: 曲の演奏など position: 2 content_type_00003: id: 3 name: two_dimensional_moving_image - display_name: "en: Two-dimensional moving image\r\n\ - ja: 動画" + display_name_translations: {"en": "Two-dimensional moving image", "ja": "動画"} note: position: 3 content_type_00004: id: 4 name: tactile_text - display_name: "en: Tactile text\r\n\ - ja: 点字など" + display_name_translations: {"en": "Tactile text", "ja": "点字など"} note: 触ることのできる文字 position: 4 content_type_00005: id: 5 name: still_image - display_name: "en: Still image\r\n\ - ja: 画像" + display_name_translations: {"en": "Still image", "ja": "画像"} note: 静止画像 position: 5 content_type_00006: id: 6 name: cartographic_image - display_name: "en: Cartographic image\r\n\ - ja: 地図" + display_name_translations: {"en": "Cartographic image", "ja": "地図"} note: position: 6 content_type_00007: id: 7 name: spoken_word - display_name: "en: Spoken word\r\n\ - ja: 音声" + display_name_translations: {"en": "Spoken word", "ja": "音声"} note: 読み上げ音声など position: 7 content_type_00008: id: 8 name: sounds - display_name: "en: Sounds\r\n\ - ja: 音" + display_name_translations: {"en": "Sounds", "ja": "音"} note: 波音など position: 8 content_type_00009: id: 9 name: notated_music - display_name: "en: Notated music\r\n\ - ja: 楽譜" + display_name_translations: {"en": "Notated music", "ja": "楽譜"} note: position: 9 content_type_00010: id: 10 name: three_dimensional_moving_image - display_name: "en: Three-dimensional moving image\r\n\ - ja: 3D動画" + display_name_translations: {"en": "Three-dimensional moving image", "ja": "3D動画"} note: position: 10 content_type_00011: id: 11 name: other - display_name: "en: Other\r\n\ - ja: その他" + display_name_translations: {"en": "Other", "ja": "その他"} note: LCMARCに由来 position: 11 content_type_00012: id: 12 name: unspecified - display_name: "en: Unspecified\r\n\ - ja: 不明" + display_name_translations: {"en": "Unspecified", "ja": "不明"} note: LCMARCに由来 position: 12 @@ -88,11 +76,12 @@ content_type_00012: # # Table name: content_types # -# id :integer not null, primary key -# name :string not null -# display_name :text -# note :text -# position :integer -# created_at :datetime -# updated_at :datetime +# id :integer not null, primary key +# name :string not null +# display_name :text +# note :text +# position :integer +# created_at :datetime +# updated_at :datetime +# display_name_translations :jsonb not null # diff --git a/spec/fixtures/event_categories.yml b/spec/fixtures/event_categories.yml index f884bd6f..60b4520f 100644 --- a/spec/fixtures/event_categories.yml +++ b/spec/fixtures/event_categories.yml @@ -1,55 +1,55 @@ --- +event_category_00001: + name: unknown + display_name_translations: {"en": "(not specified)", "ja": "未定"} + updated_at: 2008-01-01 16:24:17.869192 +09:00 + id: 1 + note: "" + created_at: 2008-01-01 16:17:12.549565 +09:00 + position: 1 event_category_00002: name: closed - display_name: 休館日 + display_name_translations: {"en": "closed", "ja": "休館日"} updated_at: 2008-01-01 16:24:32.561469 +09:00 id: 2 note: "" created_at: 2008-01-01 16:17:34.642433 +09:00 position: 2 event_category_00003: - name: おはなし会 - display_name: おはなし会 + name: book_talk + display_name_translations: {"en": "talk event", "ja": "おはなし会"} updated_at: 2008-01-01 16:24:45.267241 +09:00 id: 3 note: "" created_at: 2008-01-01 16:17:45.415487 +09:00 position: 3 event_category_00004: - name: 上映会 - display_name: 上映会 + name: movie_theater + display_name_translations: {"en": "screening", "ja": "上映会"} updated_at: 2008-01-01 16:24:55.261682 +09:00 id: 4 note: "" created_at: 2008-01-01 16:18:08.868680 +09:00 position: 4 event_category_00005: - name: 講演会 - display_name: 講演会 + name: talk_event + display_name_translations: {"en": "seminar", "ja": "講演会"} updated_at: 2008-01-01 16:25:04.251141 +09:00 id: 5 note: "" created_at: 2008-01-01 16:25:04.251141 +09:00 position: 5 -event_category_00001: - name: unknown - display_name: (not specified) - updated_at: 2008-01-01 16:24:17.869192 +09:00 - id: 1 - note: "" - created_at: 2008-01-01 16:17:12.549565 +09:00 - position: 1 # == Schema Information # # Table name: event_categories # -# id :integer not null, primary key -# name :string(255) not null -# display_name :text -# note :text -# position :integer -# created_at :datetime -# updated_at :datetime +# id :integer not null, primary key +# name :string not null +# display_name :text +# note :text +# position :integer +# created_at :datetime +# updated_at :datetime +# display_name_translations :jsonb not null # - diff --git a/spec/fixtures/frequencies.yml b/spec/fixtures/frequencies.yml index a78729fa..61f3c23c 100644 --- a/spec/fixtures/frequencies.yml +++ b/spec/fixtures/frequencies.yml @@ -1,56 +1,47 @@ --- frequency_00001: name: unknown - display_name: "en: unknown\r\n\ - ja: 不明・不定期刊" + display_name_translations: {"en": "unknown", "ja": "不明・不定期刊"} id: 1 position: 1 frequency_00002: name: daily - display_name: "en: daily\r\n\ - ja: 日刊" + display_name_translations: {"en": "daily", "ja": "日刊"} id: 2 position: 2 frequency_00003: name: weekly - display_name: "en: weekly\r\n\ - ja: 週刊" + display_name_translations: {"en": "weekly", "ja": "週刊"} id: 3 position: 3 frequency_00004: name: biweekly - display_name: "en: biweekly\r\n\ - ja: 隔週刊" + display_name_translations: {"en": "biweekly", "ja": "隔週刊"} id: 4 position: 4 frequency_00005: name: monthly - display_name: "en: monthly\r\n\ - ja: 月刊" + display_name_translations: {"en": "monthly", "ja": "月刊"} id: 5 position: 5 frequency_00006: name: bimonthly - display_name: "en: bimonthly\r\n\ - ja: 隔月刊" + display_name_translations: {"en": "bimonthly", "ja": "隔月刊"} id: 6 position: 6 frequency_00007: name: quarterly - display_name: "en: quarterly\r\n\ - ja: 季刊" + display_name_translations: {"en": "quarterly", "ja": "季刊"} id: 7 position: 7 frequency_00008: name: yearly - display_name: "en: yearly\r\n\ - ja: 年刊" + display_name_translations: {"en": "yearly", "ja": "年刊"} id: 8 position: 8 frequency_00009: name: biyearly - display_name: "en: biyearly\r\n\ - ja: 隔年刊" + display_name_translations: {"en": "biyearly", "ja": "隔年刊"} id: 9 position: 9 @@ -58,11 +49,12 @@ frequency_00009: # # Table name: frequencies # -# id :integer not null, primary key -# name :string not null -# display_name :text -# note :text -# position :integer -# created_at :datetime -# updated_at :datetime +# id :integer not null, primary key +# name :string not null +# display_name :text +# note :text +# position :integer +# created_at :datetime +# updated_at :datetime +# display_name_translations :jsonb not null # diff --git a/spec/fixtures/user_group_has_checkout_types.yml b/spec/fixtures/user_group_has_checkout_types.yml index 1e484eb6..b0ad8d95 100644 --- a/spec/fixtures/user_group_has_checkout_types.yml +++ b/spec/fixtures/user_group_has_checkout_types.yml @@ -92,19 +92,19 @@ user_group_has_checkout_type_00008: # # Table name: user_group_has_checkout_types # -# id :integer not null, primary key -# user_group_id :integer not null -# checkout_type_id :integer not null -# checkout_limit :integer default(0), not null -# checkout_period :integer default(0), not null -# checkout_renewal_limit :integer default(0), not null -# reservation_limit :integer default(0), not null -# reservation_expired_period :integer default(7), not null +# id :integer not null, primary key +# user_group_id :integer not null +# checkout_type_id :integer not null +# checkout_limit :integer default(0), not null +# checkout_period :integer default(0), not null +# checkout_renewal_limit :integer default(0), not null +# reservation_limit :integer default(0), not null +# reservation_expired_period :integer default(7), not null # set_due_date_after_closing_day :boolean default(FALSE), not null -# fixed_due_date :datetime -# note :text -# position :integer -# created_at :datetime -# updated_at :datetime -# current_checkout_count :integer +# fixed_due_date :datetime +# note :text +# position :integer +# created_at :datetime +# updated_at :datetime +# current_checkout_count :integer # diff --git a/spec/models/user_group_has_checkout_type_spec.rb b/spec/models/user_group_has_checkout_type_spec.rb index 679f005c..5590c788 100644 --- a/spec/models/user_group_has_checkout_type_spec.rb +++ b/spec/models/user_group_has_checkout_type_spec.rb @@ -29,19 +29,19 @@ # # Table name: user_group_has_checkout_types # -# id :integer not null, primary key -# user_group_id :integer not null -# checkout_type_id :integer not null -# checkout_limit :integer default(0), not null -# checkout_period :integer default(0), not null -# checkout_renewal_limit :integer default(0), not null -# reservation_limit :integer default(0), not null -# reservation_expired_period :integer default(7), not null -# set_due_date_before_closing_day :boolean default(FALSE), not null -# fixed_due_date :datetime -# note :text -# position :integer -# created_at :datetime -# updated_at :datetime -# current_checkout_count :integer +# id :integer not null, primary key +# user_group_id :integer not null +# checkout_type_id :integer not null +# checkout_limit :integer default(0), not null +# checkout_period :integer default(0), not null +# checkout_renewal_limit :integer default(0), not null +# reservation_limit :integer default(0), not null +# reservation_expired_period :integer default(7), not null +# set_due_date_after_closing_day :boolean default(FALSE), not null +# fixed_due_date :datetime +# note :text +# position :integer +# created_at :datetime +# updated_at :datetime +# current_checkout_count :integer #