Skip to content

Commit

Permalink
update dummy migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Feb 24, 2019
1 parent 808cd42 commit 0f5ffd8
Show file tree
Hide file tree
Showing 27 changed files with 201 additions and 202 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ gem 'enju_biblio', github: 'next-l/enju_biblio'
gem 'enju_message', github: 'next-l/enju_message'
gem 'enju_event', github: 'next-l/enju_event'
gem 'rspec_junit_formatter', group: :test
gem 'sass-rails'
2 changes: 1 addition & 1 deletion app/models/carrier_type_has_checkout_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CarrierTypeHasCheckoutType < ActiveRecord::Base
# Table name: carrier_type_has_checkout_types
#
# id :bigint(8) not null, primary key
# carrier_type_id :bigint(8) not null
# carrier_type_id :uuid not null
# checkout_type_id :bigint(8) not null
# note :text
# position :integer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateCarrierTypeHasCheckoutTypes < ActiveRecord::Migration[5.2]
def change
create_table :carrier_type_has_checkout_types do |t|
t.references :carrier_type, foreign_key: true, null: false
t.references :carrier_type, foreign_key: true, null: false, type: :uuid
t.references :checkout_type, foreign_key: true, null: false
t.text :note
t.integer :position
Expand Down
1 change: 0 additions & 1 deletion spec/dummy/db/migrate/005_create_manifestations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def change
t.timestamps
t.string :access_address, index: true
t.integer :language_id, default: 1, null: false
t.integer :carrier_type_id, default: 1, null: false
t.integer :start_page
t.integer :end_page
t.integer :height
Expand Down
3 changes: 2 additions & 1 deletion spec/dummy/db/migrate/073_create_carrier_types.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
class CreateCarrierTypes < ActiveRecord::Migration[5.2]
def change
create_table :carrier_types do |t|
create_table :carrier_types, id: :uuid do |t|
t.string :name, null: false, index: {unique: true}
t.jsonb :display_name_translations, default: {}, null: false
t.text :note
t.integer :position
t.timestamps
end
add_reference :manifestations, :carrier_type, foreign_key: true, type: :uuid, null: false
end
end
4 changes: 1 addition & 3 deletions spec/dummy/db/migrate/20081027150907_create_picture_files.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
class CreatePictureFiles < ActiveRecord::Migration[5.2]
def change
create_table :picture_files do |t|
create_table :picture_files, id: :uuid do |t|
t.references :picture_attachable, null: false, type: :uuid
t.string :picture_attachable_type, null: false
t.string :content_type
t.text :title
t.string :thumbnail
t.integer :position

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateAgentImportFiles < ActiveRecord::Migration[5.2]
def change
create_table :agent_import_files do |t|
create_table :agent_import_files, id: :uuid do |t|
t.references :user, foreign_key: true
t.text :note
t.datetime :executed_at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateResourceImportFiles < ActiveRecord::Migration[5.2]
def change
create_table :resource_import_files do |t|
create_table :resource_import_files, id: :uuid do |t|
t.references :user, foreign_key: true
t.text :note
t.datetime :executed_at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateResourceImportResults < ActiveRecord::Migration[5.2]
def change
create_table :resource_import_results do |t|
t.references :resource_import_file, foreign_key: true
create_table :resource_import_results, id: :uuid do |t|
t.references :resource_import_file, foreign_key: true, type: :uuid
t.references :manifestation, type: :uuid
t.references :item, type: :uuid
t.text :body
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateAgentImportResults < ActiveRecord::Migration[5.2]
def change
create_table :agent_import_results do |t|
t.references :agent_import_file, foreign_key: true, null: false
create_table :agent_import_results, id: :uuid do |t|
t.references :agent_import_file, foreign_key: true, null: false, type: :uuid
t.references :agent, type: :uuid
t.text :body

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateUserImportFiles < ActiveRecord::Migration[5.2]
def change
create_table :user_import_files do |t|
create_table :user_import_files, id: :uuid do |t|
t.references :user, foreign_key: true
t.text :note
t.datetime :executed_at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreateUserImportResults < ActiveRecord::Migration[5.2]
def change
create_table :user_import_results do |t|
t.references :user_import_file, foreign_key: true
create_table :user_import_results, id: :uuid do |t|
t.references :user_import_file, foreign_key: true, type: :uuid
t.references :user, foreign_key: true
t.text :body

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def change
t.string :to_state
t.jsonb :metadata, default: {}
t.integer :sort_key
t.references :resource_import_file, index: false
t.references :resource_import_file, index: false, type: :uuid
t.timestamps
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def change
t.string :to_state
t.jsonb :metadata, default: {}
t.integer :sort_key
t.references :agent_import_file
t.references :agent_import_file, type: :uuid
t.timestamps
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def change
t.string :to_state
t.jsonb :metadata, default: {}
t.integer :sort_key
t.references :user_import_file
t.references :user_import_file, type: :uuid
t.timestamps
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateResourceExportFiles < ActiveRecord::Migration[5.2]
def change
create_table :resource_export_files do |t|
create_table :resource_export_files, id: :uuid do |t|
t.references :user, foreign_key: true
t.datetime :executed_at

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def change
t.string :to_state
t.jsonb :metadata, default: {}
t.integer :sort_key
t.references :resource_export_file, index: false
t.references :resource_export_file, index: false, type: :uuid
t.timestamps
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateUserExportFiles < ActiveRecord::Migration[5.2]
def change
create_table :user_export_files do |t|
create_table :user_export_files, id: :uuid do |t|
t.references :user, foreign_key: true
t.datetime :executed_at

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def change
t.string :to_state
t.jsonb :metadata, default: {}
t.integer :sort_key
t.references :user_export_file
t.references :user_export_file, type: :uuid
t.timestamps
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def change

create_table :active_storage_attachments do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false
t.references :record, null: false, polymorphic: true, index: false, type: :uuid
t.references :blob, null: false

t.datetime :created_at, null: false
Expand Down
46 changes: 23 additions & 23 deletions spec/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.uuid "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
Expand All @@ -52,7 +52,7 @@
t.string "to_state"
t.jsonb "metadata", default: {}
t.integer "sort_key"
t.bigint "agent_import_file_id"
t.uuid "agent_import_file_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "most_recent", null: false
Expand All @@ -61,7 +61,7 @@
t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
end

create_table "agent_import_files", force: :cascade do |t|
create_table "agent_import_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.bigint "user_id"
t.text "note"
t.datetime "executed_at"
Expand All @@ -74,8 +74,8 @@
t.index ["user_id"], name: "index_agent_import_files_on_user_id"
end

create_table "agent_import_results", force: :cascade do |t|
t.bigint "agent_import_file_id", null: false
create_table "agent_import_results", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "agent_import_file_id", null: false
t.uuid "agent_id"
t.text "body"
t.datetime "created_at", null: false
Expand Down Expand Up @@ -215,7 +215,7 @@
end

create_table "carrier_type_has_checkout_types", force: :cascade do |t|
t.bigint "carrier_type_id", null: false
t.uuid "carrier_type_id", null: false
t.bigint "checkout_type_id", null: false
t.text "note"
t.integer "position"
Expand All @@ -225,7 +225,7 @@
t.index ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
end

create_table "carrier_types", force: :cascade do |t|
create_table "carrier_types", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.string "name", null: false
t.jsonb "display_name_translations", default: {}, null: false
t.text "note"
Expand Down Expand Up @@ -840,7 +840,6 @@
t.datetime "updated_at", null: false
t.string "access_address"
t.integer "language_id", default: 1, null: false
t.integer "carrier_type_id", default: 1, null: false
t.integer "start_page"
t.integer "end_page"
t.integer "height"
Expand All @@ -858,6 +857,7 @@
t.integer "required_role_id", default: 1, null: false
t.integer "frequency_id", default: 1, null: false
t.boolean "subscription_master", default: false, null: false
t.uuid "carrier_type_id", null: false
t.text "title_alternative_transcription"
t.text "description"
t.text "abstract"
Expand All @@ -881,6 +881,7 @@
t.text "extent"
t.text "dimensions"
t.index ["access_address"], name: "index_manifestations_on_access_address"
t.index ["carrier_type_id"], name: "index_manifestations_on_carrier_type_id"
t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier", unique: true
t.index ["updated_at"], name: "index_manifestations_on_updated_at"
Expand Down Expand Up @@ -984,12 +985,10 @@
t.index ["event_id"], name: "index_participates_on_event_id"
end

create_table "picture_files", force: :cascade do |t|
create_table "picture_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "picture_attachable_id", null: false
t.string "picture_attachable_type", null: false
t.string "content_type"
t.text "title"
t.string "thumbnail"
t.integer "position"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
Expand Down Expand Up @@ -1156,7 +1155,7 @@
t.string "to_state"
t.jsonb "metadata", default: {}
t.integer "sort_key"
t.bigint "resource_export_file_id"
t.uuid "resource_export_file_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "most_recent", null: false
Expand All @@ -1165,7 +1164,7 @@
t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
end

create_table "resource_export_files", force: :cascade do |t|
create_table "resource_export_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.bigint "user_id"
t.datetime "executed_at"
t.datetime "created_at", null: false
Expand All @@ -1177,7 +1176,7 @@
t.string "to_state"
t.jsonb "metadata", default: {}
t.integer "sort_key"
t.bigint "resource_import_file_id"
t.uuid "resource_import_file_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "most_recent", null: false
Expand All @@ -1186,7 +1185,7 @@
t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
end

create_table "resource_import_files", force: :cascade do |t|
create_table "resource_import_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.bigint "user_id"
t.text "note"
t.datetime "executed_at"
Expand All @@ -1201,8 +1200,8 @@
t.index ["user_id"], name: "index_resource_import_files_on_user_id"
end

create_table "resource_import_results", force: :cascade do |t|
t.bigint "resource_import_file_id"
create_table "resource_import_results", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "resource_import_file_id"
t.uuid "manifestation_id"
t.uuid "item_id"
t.text "body"
Expand Down Expand Up @@ -1352,7 +1351,7 @@
t.string "to_state"
t.jsonb "metadata", default: {}
t.integer "sort_key"
t.bigint "user_export_file_id"
t.uuid "user_export_file_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "most_recent", null: false
Expand All @@ -1361,7 +1360,7 @@
t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
end

create_table "user_export_files", force: :cascade do |t|
create_table "user_export_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.bigint "user_id"
t.datetime "executed_at"
t.datetime "created_at", null: false
Expand Down Expand Up @@ -1416,7 +1415,7 @@
t.string "to_state"
t.jsonb "metadata", default: {}
t.integer "sort_key"
t.bigint "user_import_file_id"
t.uuid "user_import_file_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "most_recent", null: false
Expand All @@ -1425,7 +1424,7 @@
t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
end

create_table "user_import_files", force: :cascade do |t|
create_table "user_import_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.bigint "user_id"
t.text "note"
t.datetime "executed_at"
Expand All @@ -1441,8 +1440,8 @@
t.index ["user_id"], name: "index_user_import_files_on_user_id"
end

create_table "user_import_results", force: :cascade do |t|
t.bigint "user_import_file_id"
create_table "user_import_results", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "user_import_file_id"
t.bigint "user_id"
t.text "body"
t.datetime "created_at", null: false
Expand Down Expand Up @@ -1576,6 +1575,7 @@
add_foreign_key "manifestation_relationships", "manifestations", column: "child_id"
add_foreign_key "manifestation_relationships", "manifestations", column: "parent_id"
add_foreign_key "manifestation_reserve_stats", "users"
add_foreign_key "manifestations", "carrier_types"
add_foreign_key "messages", "messages", column: "parent_id"
add_foreign_key "participates", "events"
add_foreign_key "produces", "agents"
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/manifestation.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :manifestation do |f|
f.sequence(:original_title){|n| "manifestation_title_#{n}"}
f.carrier_type_id{CarrierType.find(1).id}
f.carrier_type_id{CarrierType.find_by(name: 'volume').id}
end
end
Loading

0 comments on commit 0f5ffd8

Please sign in to comment.