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 May 6, 2020
1 parent f457845 commit e7f2485
Show file tree
Hide file tree
Showing 44 changed files with 339 additions and 193 deletions.
4 changes: 2 additions & 2 deletions app/models/manifestation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ class Manifestation < ApplicationRecord
# original_title :text not null
# title_alternative :text
# title_transcription :text
# classification_number :string
# manifestation_identifier :string
# date_of_publication :datetime
# date_copyrighted :datetime
# date_of_publication :datetime
# created_at :datetime not null
# updated_at :datetime not null
# access_address :string
Expand Down Expand Up @@ -68,4 +67,5 @@ class Manifestation < ApplicationRecord
# extent :text
# dimensions :text
# memo :text
# license_id :bigint default(1), not null
#
9 changes: 0 additions & 9 deletions package.json

This file was deleted.

2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/001_create_agents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def change
t.integer :country_id, default: 1, null: false
t.integer :agent_type_id, default: 1, null: false
t.integer :lock_version, default: 0, null: false
t.text :note
t.text :note, comment: '備考'
t.integer :required_role_id, default: 1, null: false
t.integer :required_score, default: 0, null: false
t.text :email
Expand Down
15 changes: 7 additions & 8 deletions spec/dummy/db/migrate/005_create_manifestations.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
class CreateManifestations < ActiveRecord::Migration[5.2]
def change
create_table :manifestations do |t|
t.text :original_title, null: false
create_table :manifestations, comment: '書誌' do |t|
t.text :original_title, null: false, comment: 'タイトル'
t.text :title_alternative
t.text :title_transcription
t.string :classification_number
t.string :manifestation_identifier
t.datetime :date_of_publication
t.datetime :copyright_date
t.datetime :date_of_publication, comment: '出版日'
t.timestamps
t.string :access_address
t.string :access_address, comment: 'アクセスアドレス'
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 :start_page, comment: '開始ページ'
t.integer :end_page, comment: '終了ページ'
t.integer :height
t.integer :width
t.integer :depth
Expand All @@ -23,7 +22,7 @@ def change
t.string :issue_number_string
t.string :serial_number_string
t.integer :edition
t.text :note
t.text :note, comment: '備考'
t.boolean :repository_content, default: false, null: false
t.integer :lock_version, default: 0, null: false
t.integer :required_role_id, default: 1, null: false
Expand Down
18 changes: 9 additions & 9 deletions spec/dummy/db/migrate/006_create_items.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
class CreateItems < ActiveRecord::Migration[5.2]
def change
create_table :items do |t|
t.string :call_number
t.string :item_identifier
create_table :items, comment: '所蔵' do |t|
t.string :call_number, comment: '請求記号'
t.string :item_identifier, comment: '所蔵情報ID'
t.timestamps
t.integer :shelf_id, default: 1, null: false
t.boolean :include_supplements, default: false, null: false
t.text :note
t.string :url
t.integer :price
t.integer :shelf_id, default: 1, null: false, comment: '書架ID'
t.boolean :include_supplements, default: false, null: false, comment: '付録の有無'
t.text :note, comment: '備考'
t.string :url, comment: 'URL'
t.integer :price, comment: '価格'
t.integer :lock_version, default: 0, null: false
t.integer :required_role_id, default: 1, null: false
t.integer :required_role_id, default: 1, null: false, comment: '参照に必要な権限ID'
t.integer :required_score, default: 0, null: false
end
add_index :items, :shelf_id
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/015_create_creates.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateCreates < ActiveRecord::Migration[5.2]
def change
create_table :creates do |t|
create_table :creates, comment: '著者と書誌の関係' do |t|
t.references :agent, null: false
t.references :work, null: false
t.integer :position
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/047_create_produces.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateProduces < ActiveRecord::Migration[5.2]
def change
create_table :produces do |t|
create_table :produces, comment: '出版者と書誌の関係' do |t|
t.references :agent, null: false
t.references :manifestation, null: false
t.integer :position
Expand Down
3 changes: 1 addition & 2 deletions spec/dummy/db/migrate/073_create_carrier_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateCarrierTypes < ActiveRecord::Migration[5.2]
def change
create_table :carrier_types do |t|
t.string :name, null: false
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position
t.timestamps
end
Expand Down
5 changes: 2 additions & 3 deletions spec/dummy/db/migrate/112_create_frequencies.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class CreateFrequencies < ActiveRecord::Migration[5.2]
def change
create_table :frequencies do |t|
create_table :frequencies, comment: '発行頻度' do |t|
t.string :name, null: false
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
3 changes: 1 addition & 2 deletions spec/dummy/db/migrate/117_create_form_of_works.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateFormOfWorks < ActiveRecord::Migration[5.2]
def change
create_table :form_of_works do |t|
t.string :name, null: false
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
8 changes: 2 additions & 6 deletions spec/dummy/db/migrate/134_create_agent_merge_lists.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
class CreateAgentMergeLists < ActiveRecord::Migration[5.2]
def self.up
def change
create_table :agent_merge_lists do |t|
t.string :title
t.string :title, null: false

t.timestamps
end
end

def self.down
drop_table :agent_merge_lists
end
end
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/20080830154109_create_realizes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateRealizes < ActiveRecord::Migration[5.2]
def change
create_table :realizes do |t|
create_table :realizes, comment: '編者と書誌の関係' do |t|
t.references :agent, null: false
t.references :expression, null: false
t.integer :position
Expand Down
3 changes: 1 addition & 2 deletions spec/dummy/db/migrate/20080905191442_create_agent_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateAgentTypes < ActiveRecord::Migration[5.2]
def change
create_table :agent_types do |t|
t.string :name, null: false
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/20081025083323_create_countries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ class CreateCountries < ActiveRecord::Migration[5.2]
# http://www.iso.org/iso/country_codes/background_on_iso_3166/what_is_iso_3166.htm

def change
create_table :countries do |t|
create_table :countries, comment: '国・地域' do |t|
t.string :name, size: 80, null: false
t.text :display_name
t.string :alpha_2, size: 2
t.string :alpha_3, size: 3
t.string :numeric_3, size: 3
t.text :note
t.text :note, comment: '備考'
t.integer :position
end
add_index :countries, :name
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/20081025083905_create_languages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ class CreateLanguages < ActiveRecord::Migration[5.2]
# Information on macrolanguages http://en.wikipedia.org/wiki/ISO_639_macrolanguage

def change
create_table :languages do |t|
create_table :languages, comment: '言語' do |t|
t.string :name, null: false
t.string :native_name
t.text :display_name
t.string :iso_639_1, size: 3
t.string :iso_639_2, size: 3
t.string :iso_639_3, size: 3
t.text :note
t.text :note, comment: '備考'
t.integer :position
end
add_index :languages, :name, unique: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateAgentImportFiles < ActiveRecord::Migration[5.2]
def change
create_table :agent_import_files do |t|
t.references :user, foreign_key: true
t.text :note
create_table :agent_import_files, comment: '人物情報インポートファイル' do |t|
t.references :user, foreign_key: true, comment: 'アップロードユーザ'
t.text :note, comment: '備考'
t.datetime :executed_at

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateResourceImportFiles < ActiveRecord::Migration[5.2]
def change
create_table :resource_import_files do |t|
t.references :user, foreign_key: true
t.text :note
create_table :resource_import_files, comment: '書誌情報インポートファイル' do |t|
t.references :user, foreign_key: true, comment: 'アップロードユーザ'
t.text :note, comment: '備考'
t.datetime :executed_at

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateMediumOfPerformances < ActiveRecord::Migration[5.2]
def change
create_table :medium_of_performances do |t|
t.string :name, null: false
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
3 changes: 1 addition & 2 deletions spec/dummy/db/migrate/20090720091429_create_content_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateContentTypes < ActiveRecord::Migration[5.2]
def change
create_table :content_types do |t|
t.string :name, null: false
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateAgentRelationshipTypes < ActiveRecord::Migration[5.2]
def change
create_table :agent_relationship_types do |t|
t.string :name, null: false
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
5 changes: 2 additions & 3 deletions spec/dummy/db/migrate/20091025080447_create_licenses.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class CreateLicenses < ActiveRecord::Migration[5.2]
def change
create_table :licenses do |t|
create_table :licenses, comment: 'ライセンス' do |t|
t.string :name, null: false
t.string :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateManifestationRelationshipTypes < ActiveRecord::Migration[5.2]
def change
create_table :manifestation_relationship_types do |t|
t.string :name, null: false
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
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.integer :agent_import_file_id
t.references :agent_import_file, foreign_key: true
t.integer :agent_id
t.text :body

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ def self.up
end

def self.down
remove_column :series_statements, :note
remove_column :series_statements, :note, comment: '備考'
end
end
3 changes: 1 addition & 2 deletions spec/dummy/db/migrate/20111124110059_create_create_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateCreateTypes < ActiveRecord::Migration[5.2]
def change
create_table :create_types do |t|
t.string :name
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
3 changes: 1 addition & 2 deletions spec/dummy/db/migrate/20111124110319_create_realize_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateRealizeTypes < ActiveRecord::Migration[5.2]
def change
create_table :realize_types do |t|
t.string :name
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
3 changes: 1 addition & 2 deletions spec/dummy/db/migrate/20111124110355_create_produce_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ class CreateProduceTypes < ActiveRecord::Migration[5.2]
def change
create_table :produce_types do |t|
t.string :name
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def change
create_table :identifier_types do |t|
t.string :name
t.text :display_name
t.text :note
t.text :note, comment: '備考'
t.integer :position

t.timestamps
Expand Down
8 changes: 4 additions & 4 deletions spec/dummy/db/migrate/20160319144230_create_issn_records.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class CreateIssnRecords < ActiveRecord::Migration[5.2]
def change
create_table :issn_records do |t|
t.string :body, index: {unique: true}, null: false
t.string :issn_type
t.string :source
create_table :issn_records, comment: 'ISSN' do |t|
t.string :body, index: {unique: true}, null: false, comment: 'ISSN'
t.string :issn_type, comment: 'ISSNの種類'
t.string :source, comment: '情報源'

t.timestamps
end
Expand Down
8 changes: 4 additions & 4 deletions spec/dummy/db/migrate/20160506144040_create_isbn_records.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class CreateIsbnRecords < ActiveRecord::Migration[5.2]
def change
create_table :isbn_records do |t|
t.string :body, index: {unique: true}, null: false
t.string :isbn_type
t.string :source
create_table :isbn_records, comment: 'ISBN' do |t|
t.string :body, index: {unique: true}, null: false, comment: 'ISBN'
t.string :isbn_type, comment: 'ISBNの種類'
t.string :source, comment: '情報源'

t.timestamps
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateIssnRecordAndManifestations < ActiveRecord::Migration[5.2]
def change
create_table :issn_record_and_manifestations do |t|
create_table :issn_record_and_manifestations, comment: '書誌とISSNの関係' do |t|
t.references :issn_record, foreign_key: true, on_delete: :cascade, null: false
t.references :manifestation, foreign_key: true, on_delete: :cascade, null: false
t.integer :position
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateIsbnRecordAndManifestations < ActiveRecord::Migration[5.2]
def change
create_table :isbn_record_and_manifestations do |t|
create_table :isbn_record_and_manifestations, comment: '書誌とISBNの関係' do |t|
t.references :isbn_record, foreign_key: true, on_delete: :cascade, null: false
t.references :manifestation, foreign_key: true, null: false, on_delete: :cascade
t.integer :position
Expand Down
Loading

0 comments on commit e7f2485

Please sign in to comment.