Skip to content

Commit

Permalink
add dummy migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed May 9, 2017
1 parent f22640a commit 42cab38
Show file tree
Hide file tree
Showing 90 changed files with 1,026 additions and 0 deletions.
50 changes: 50 additions & 0 deletions spec/dummy/db/migrate/001_create_agents.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
class CreateAgents < ActiveRecord::Migration
def change
create_table :agents do |t|
t.string :last_name
t.string :middle_name
t.string :first_name
t.string :last_name_transcription
t.string :middle_name_transcription
t.string :first_name_transcription
t.string :corporate_name
t.string :corporate_name_transcription
t.string :full_name
t.text :full_name_transcription
t.text :full_name_alternative
t.timestamps
t.datetime :deleted_at
t.string :zip_code_1
t.string :zip_code_2
t.text :address_1
t.text :address_2
t.text :address_1_note
t.text :address_2_note
t.string :telephone_number_1
t.string :telephone_number_2
t.string :fax_number_1
t.string :fax_number_2
t.text :other_designation
t.text :place
t.string :postal_code
t.text :street
t.text :locality
t.text :region
t.datetime :date_of_birth
t.datetime :date_of_death
t.integer :language_id, :default => 1, :null => false
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.integer :required_role_id, :default => 1, :null => false
t.integer :required_score, :default => 0, :null => false
t.text :email
t.text :url
end
add_index :agents, :language_id
add_index :agents, :country_id
add_index :agents, :required_role_id
add_index :agents, :full_name
end
end
43 changes: 43 additions & 0 deletions spec/dummy/db/migrate/005_create_manifestations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
class CreateManifestations < ActiveRecord::Migration
def change
create_table :manifestations do |t|
t.text :original_title, :null => false
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.timestamps
t.datetime :deleted_at
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
t.integer :width
t.integer :depth
t.integer :price # TODO: 通貨単位
t.text :fulltext
t.string :volume_number_string
t.string :issue_number_string
t.string :serial_number_string
t.integer :edition
t.text :note
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
t.integer :required_score, :default => 0, :null => false
t.integer :frequency_id, :default => 1, :null => false
t.boolean :subscription_master, :default => false, :null => false
end
#add_index :manifestations, :carrier_type_id
#add_index :manifestations, :required_role_id
add_index :manifestations, :access_address
#add_index :manifestations, :frequency_id
add_index :manifestations, :manifestation_identifier
add_index :manifestations, :updated_at
add_index :manifestations, :date_of_publication
end
end
21 changes: 21 additions & 0 deletions spec/dummy/db/migrate/006_create_items.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class CreateItems < ActiveRecord::Migration
def change
create_table :items do |t|
t.string :call_number
t.string :item_identifier
t.timestamps
t.datetime :deleted_at
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 :lock_version, :default => 0, :null => false
t.integer :required_role_id, :default => 1, :null => false
t.integer :required_score, :default => 0, :null => false
end
add_index :items, :shelf_id
add_index :items, :item_identifier
add_index :items, :required_role_id
end
end
12 changes: 12 additions & 0 deletions spec/dummy/db/migrate/012_create_owns.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateOwns < ActiveRecord::Migration
def change
create_table :owns do |t|
t.references :agent, :null => false
t.references :item, :null => false
t.integer :position
t.timestamps
end
add_index :owns, :agent_id
add_index :owns, :item_id
end
end
12 changes: 12 additions & 0 deletions spec/dummy/db/migrate/015_create_creates.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateCreates < ActiveRecord::Migration
def change
create_table :creates do |t|
t.references :agent, :null => false
t.references :work, :null => false
t.integer :position
t.timestamps
end
add_index :creates, :agent_id
add_index :creates, :work_id
end
end
12 changes: 12 additions & 0 deletions spec/dummy/db/migrate/047_create_produces.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateProduces < ActiveRecord::Migration
def change
create_table :produces do |t|
t.references :agent, :null => false
t.references :manifestation, :null => false
t.integer :position
t.timestamps
end
add_index :produces, :agent_id
add_index :produces, :manifestation_id
end
end
11 changes: 11 additions & 0 deletions spec/dummy/db/migrate/073_create_carrier_types.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateCarrierTypes < ActiveRecord::Migration
def change
create_table :carrier_types do |t|
t.string :name, :null => false
t.text :display_name
t.text :note
t.integer :position
t.timestamps
end
end
end
12 changes: 12 additions & 0 deletions spec/dummy/db/migrate/112_create_frequencies.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateFrequencies < ActiveRecord::Migration
def change
create_table :frequencies do |t|
t.string :name, :null => false
t.text :display_name
t.text :note
t.integer :position

t.timestamps
end
end
end
12 changes: 12 additions & 0 deletions spec/dummy/db/migrate/117_create_form_of_works.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateFormOfWorks < ActiveRecord::Migration
def change
create_table :form_of_works do |t|
t.string :name, :null => false
t.text :display_name
t.text :note
t.integer :position

t.timestamps
end
end
end
12 changes: 12 additions & 0 deletions spec/dummy/db/migrate/125_create_donates.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateDonates < ActiveRecord::Migration
def change
create_table :donates do |t|
t.integer :agent_id, :null => false
t.integer :item_id, :null => false

t.timestamps
end
add_index :donates, :agent_id
add_index :donates, :item_id
end
end
15 changes: 15 additions & 0 deletions spec/dummy/db/migrate/133_create_agent_merges.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class CreateAgentMerges < ActiveRecord::Migration
def self.up
create_table :agent_merges do |t|
t.integer :agent_id, :agent_merge_list_id, :null => false

t.timestamps
end
add_index :agent_merges, :agent_id
add_index :agent_merges, :agent_merge_list_id
end

def self.down
drop_table :agent_merges
end
end
13 changes: 13 additions & 0 deletions spec/dummy/db/migrate/134_create_agent_merge_lists.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateAgentMergeLists < ActiveRecord::Migration
def self.up
create_table :agent_merge_lists do |t|
t.string :title

t.timestamps
end
end

def self.down
drop_table :agent_merge_lists
end
end
13 changes: 13 additions & 0 deletions spec/dummy/db/migrate/20080830154109_create_realizes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateRealizes < ActiveRecord::Migration
def change
create_table :realizes do |t|
t.references :agent, :null => false
t.references :expression, :null => false
t.integer :position

t.timestamps
end
add_index :realizes, :agent_id
add_index :realizes, :expression_id
end
end
12 changes: 12 additions & 0 deletions spec/dummy/db/migrate/20080905191442_create_agent_types.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateAgentTypes < ActiveRecord::Migration
def change
create_table :agent_types do |t|
t.string :name, :null => false
t.text :display_name
t.text :note
t.integer :position

t.timestamps
end
end
end
28 changes: 28 additions & 0 deletions spec/dummy/db/migrate/20081025083323_create_countries.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class CreateCountries < ActiveRecord::Migration

# ISO 3166 is the International Standard for country codes.
#
# ISO 3166-1:2006 Codes for the representation of names of countries and their subdivisions - Part 1:
# Country codes which is what most users know as ISO's country codes. First published in 1974, it is has since
# then become one of the world's most popular and most widely used standard solution for coding country names.
# It contains a two-letter code which is recommended as the general purpose code, a three-letter code which has
# better mnenomic properties and a numeric-3 code which can be useful if script independence of the codes is important.
#
# http://www.iso.org/iso/country_codes/background_on_iso_3166/what_is_iso_3166.htm

def change
create_table :countries 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.integer :position
end
add_index :countries, :name
add_index :countries, :alpha_2
add_index :countries, :alpha_3
add_index :countries, :numeric_3
end
end
23 changes: 23 additions & 0 deletions spec/dummy/db/migrate/20081025083905_create_languages.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class CreateLanguages < ActiveRecord::Migration

# ISO 639 is the set of international standards that lists short codes for language names.
# Note this doesn't include macrolanguages (dialects)
# Information on macrolanguages http://en.wikipedia.org/wiki/ISO_639_macrolanguage

def change
create_table :languages 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.integer :position
end
add_index :languages, :name, :unique => true
add_index :languages, :iso_639_1
add_index :languages, :iso_639_2
add_index :languages, :iso_639_3
end
end
15 changes: 15 additions & 0 deletions spec/dummy/db/migrate/20081027150907_create_picture_files.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class CreatePictureFiles < ActiveRecord::Migration
def change
create_table :picture_files do |t|
t.integer :picture_attachable_id
t.string :picture_attachable_type
t.string :content_type
t.text :title
t.string :thumbnail
t.integer :position

t.timestamps
end
add_index :picture_files, [:picture_attachable_id, :picture_attachable_type], :name => "index_picture_files_on_picture_attachable_id_and_type"
end
end
20 changes: 20 additions & 0 deletions spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class CreateAgentImportFiles < ActiveRecord::Migration
def change
create_table :agent_import_files do |t|
t.integer :parent_id
t.string :content_type
t.integer :size
t.integer :user_id
t.text :note
t.datetime :executed_at
t.string :agent_import_file_name
t.string :agent_import_content_type
t.integer :agent_import_file_size
t.datetime :agent_import_updated_at

t.timestamps
end
add_index :agent_import_files, :parent_id
add_index :agent_import_files, :user_id
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class CreateResourceImportFiles < ActiveRecord::Migration
def change
create_table :resource_import_files do |t|
t.integer :parent_id
t.string :content_type
t.integer :size
t.integer :user_id
t.text :note
t.datetime :executed_at
t.string :resource_import_file_name
t.string :resource_import_content_type
t.integer :resource_import_file_size
t.datetime :resource_import_updated_at

t.timestamps
end
add_index :resource_import_files, :parent_id
add_index :resource_import_files, :user_id
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class AddAttachmentsPictureToPictureFile < ActiveRecord::Migration
def self.up
add_column :picture_files, :picture_file_name, :string
add_column :picture_files, :picture_content_type, :string
add_column :picture_files, :picture_file_size, :integer
add_column :picture_files, :picture_updated_at, :datetime
end

def self.down
remove_column :picture_files, :picture_file_name
remove_column :picture_files, :picture_content_type
remove_column :picture_files, :picture_file_size
remove_column :picture_files, :picture_updated_at
end
end
Loading

0 comments on commit 42cab38

Please sign in to comment.