Skip to content

Commit

Permalink
revert using uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Apr 27, 2019
1 parent 4207560 commit 9fdbf7a
Show file tree
Hide file tree
Showing 69 changed files with 196 additions and 196 deletions.
2 changes: 1 addition & 1 deletion app/models/news_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def self.fetch_feeds
#
# Table name: news_feeds
#
# id :uuid not null, primary key
# id :bigint not null, primary key
# library_group_id :integer default(1), not null
# title :string
# url :string
Expand Down
4 changes: 2 additions & 2 deletions app/models/news_post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def check_date
#
# Table name: news_posts
#
# id :uuid not null, primary key
# id :bigint not null, primary key
# title :text
# body :text
# user_id :bigint(8) not null
# user_id :bigint not null
# start_date :datetime
# end_date :datetime
# required_role_id :integer default(1), not null
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20081031033632_create_news_feeds.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateNewsFeeds < ActiveRecord::Migration[5.2]
def change
create_table :news_feeds, id: :uuid do |t|
create_table :news_feeds do |t|
t.integer :library_group_id, default: 1, null: false
t.string :title
t.string :url
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20090126071155_create_news_posts.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateNewsPosts < ActiveRecord::Migration[5.2]
def change
create_table :news_posts, id: :uuid do |t|
create_table :news_posts do |t|
t.text :title
t.text :body
t.references :user, foreign_key: true, null: false
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/001_create_agents.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateAgents < ActiveRecord::Migration[5.2]
def change
create_table :agents, id: :uuid do |t|
create_table :agents do |t|
t.string :last_name
t.string :middle_name
t.string :first_name
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/005_create_manifestations.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateManifestations < ActiveRecord::Migration[5.2]
def change
create_table :manifestations, id: :uuid do |t|
create_table :manifestations do |t|
t.text :original_title, null: false
t.text :title_alternative
t.text :title_transcription
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/006_create_items.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class CreateItems < ActiveRecord::Migration[5.2]
def change
create_table :items, id: :uuid do |t|
create_table :items do |t|
t.string :call_number
t.string :item_identifier, index: {unique: true}
t.timestamps
t.references :shelf, type: :uuid
t.references :shelf
t.boolean :include_supplements, default: false, null: false
t.text :note
t.string :url
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/012_create_owns.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateOwns < ActiveRecord::Migration[5.2]
def change
create_table :owns do |t|
t.references :agent, null: false, type: :uuid
t.references :item, null: false, type: :uuid
t.references :agent, null: false
t.references :item, null: false
t.integer :position
t.timestamps
end
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/015_create_creates.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateCreates < ActiveRecord::Migration[5.2]
def change
create_table :creates do |t|
t.references :agent, foreign_key: true, null: false, type: :uuid
t.references :work, null: false, type: :uuid, foreign_key: {to_table: :manifestations}
t.references :agent, foreign_key: true, null: false
t.references :work, null: false, foreign_key: {to_table: :manifestations}
t.integer :position
t.timestamps
end
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/047_create_produces.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateProduces < ActiveRecord::Migration[5.2]
def change
create_table :produces do |t|
t.references :agent, foreign_key: true, null: false, type: :uuid
t.references :manifestation, foreign_key: true, null: false, type: :uuid
t.references :agent, foreign_key: true, null: false
t.references :manifestation, foreign_key: true, null: false
t.integer :position
t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/059_create_libraries.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateLibraries < ActiveRecord::Migration[5.2]
def change
create_table :libraries, id: :uuid do |t|
create_table :libraries do |t|
t.string :name, index: {unique: true}, null: false
t.jsonb :display_name_translations, default: {}, null: false
t.string :short_display_name, null: false
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/069_create_shelves.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class CreateShelves < ActiveRecord::Migration[5.2]
def change
create_table :shelves, id: :uuid do |t|
create_table :shelves do |t|
t.string :name, null: false
t.jsonb :display_name_translations, default: {}, null: false
t.text :note
t.references :library, foreign_key: true, null: false, type: :uuid
t.references :library, foreign_key: true, null: false
t.integer :items_count, default: 0, null: false
t.integer :position
t.timestamps
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/073_create_carrier_types.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class CreateCarrierTypes < ActiveRecord::Migration[5.2]
def change
create_table :carrier_types, id: :uuid do |t|
create_table :carrier_types 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
add_reference :manifestations, :carrier_type, foreign_key: true, null: false
end
end
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/077_create_user_groups.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateUserGroups < ActiveRecord::Migration[5.2]
def change
create_table :user_groups, id: :uuid do |t|
create_table :user_groups do |t|
t.string :name, index: {unique: true}, null: false
t.jsonb :display_name_translations, default: {}, null: false
t.text :note
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/120_create_baskets.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateBaskets < ActiveRecord::Migration[5.2]
def change
create_table :baskets, id: :uuid do |t|
create_table :baskets do |t|
t.references :user, foreign_key: true
t.text :note
t.integer :lock_version, default: 0, null: false
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/124_create_bookstores.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateBookstores < ActiveRecord::Migration[5.2]
def change
create_table :bookstores, id: :uuid do |t|
create_table :bookstores do |t|
t.text :name, null: false
t.string :zip_code
t.text :address
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/125_create_donates.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateDonates < ActiveRecord::Migration[5.2]
def change
create_table :donates do |t|
t.references :agent, foreign_key: true, null: false, type: :uuid
t.references :item, foreign_key: true, null: false, type: :uuid
t.references :agent, foreign_key: true, null: false
t.references :item, foreign_key: true, null: false

t.timestamps
end
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/133_create_agent_merges.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateAgentMerges < ActiveRecord::Migration[5.2]
def change
create_table :agent_merges do |t|
t.references :agent, foreign_key: true, null: false, type: :uuid
t.references :agent_merge_list, null: false, type: :uuid
t.references :agent, foreign_key: true, null: false
t.references :agent_merge_list, null: false

t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/134_create_agent_merge_lists.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateAgentMergeLists < ActiveRecord::Migration[5.2]
def change
create_table :agent_merge_lists, id: :uuid do |t|
create_table :agent_merge_lists do |t|
t.string :title

t.timestamps
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/20080830154109_create_realizes.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateRealizes < ActiveRecord::Migration[5.2]
def change
create_table :realizes do |t|
t.references :agent, foreign_key: true, null: false, type: :uuid
t.references :expression, null: false, type: :uuid, foreign_key: {to_table: :manifestations}
t.references :agent, foreign_key: true, null: false
t.references :expression, null: false, foreign_key: {to_table: :manifestations}
t.integer :position

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateSubscriptions < ActiveRecord::Migration[5.2]
def change
create_table :subscriptions, id: :uuid do |t|
create_table :subscriptions do |t|
t.text :title, null: false
t.text :note
t.references :user, foreign_key: true
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/20081006093246_create_subscribes.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateSubscribes < ActiveRecord::Migration[5.2]
def change
create_table :subscribes do |t|
t.references :subscription, foreign_key: true, null: false, type: :uuid
t.references :work, null: false, type: :uuid
t.references :subscription, foreign_key: true, null: false
t.references :work, null: false
t.datetime :start_at, null: false
t.datetime :end_at, null: false

Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/db/migrate/20081027150907_create_picture_files.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class CreatePictureFiles < ActiveRecord::Migration[5.2]
def change
create_table :picture_files, id: :uuid do |t|
t.references :picture_attachable, null: false, type: :uuid
create_table :picture_files do |t|
t.references :picture_attachable, null: false
t.string :picture_attachable_type, null: false
t.text :title
t.integer :position
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, id: :uuid do |t|
create_table :agent_import_files 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, id: :uuid do |t|
create_table :resource_import_files 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 CreateSeriesStatements < ActiveRecord::Migration[5.2]
def change
create_table :series_statements, id: :uuid do |t|
create_table :series_statements do |t|
t.text :title, null: false
t.text :numbering
t.text :title_subseries
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateImportRequests < ActiveRecord::Migration[5.2]
def change
create_table :import_requests, id: :uuid do |t|
create_table :import_requests do |t|
t.string :isbn, index: true, null: false
t.references :manifestation, foreign_key: true, type: :uuid
t.references :manifestation, foreign_key: true
t.references :user, foreign_key: true

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateManifestationRelationships < ActiveRecord::Migration[5.2]
def change
create_table :manifestation_relationships do |t|
t.references :parent, foreign_key: {to_table: :manifestations}, null: false, type: :uuid
t.references :child, foreign_key: {to_table: :manifestations}, null: false, type: :uuid
t.references :parent, foreign_key: {to_table: :manifestations}, null: false
t.references :child, foreign_key: {to_table: :manifestations}, null: false
t.references :manifestation_relationship_type, index: false

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateAgentRelationships < ActiveRecord::Migration[5.2]
def change
create_table :agent_relationships do |t|
t.references :parent, foreign_key: {to_table: :agents}, null: false, type: :uuid
t.references :child, foreign_key: {to_table: :agents}, null: false, type: :uuid
t.references :parent, foreign_key: {to_table: :agents}, null: false
t.references :child, foreign_key: {to_table: :agents}, null: false
t.references :agent_relationship_type, index: false

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class CreateResourceImportResults < ActiveRecord::Migration[5.2]
def change
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
create_table :resource_import_results do |t|
t.references :resource_import_file, foreign_key: true
t.references :manifestation
t.references :item
t.text :body

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateAgentImportResults < ActiveRecord::Migration[5.2]
def change
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
create_table :agent_import_results do |t|
t.references :agent_import_file, foreign_key: true, null: false
t.references :agent
t.text :body

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class AddBookstoreIdToItem < ActiveRecord::Migration[5.2]
def change
add_reference :items, :bookstore, foreign_key: true, type: :uuid
add_reference :items, :bookstore, foreign_key: true
end
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CreateSeriesStatementMergeLists < ActiveRecord::Migration[5.2]
def change
create_table :series_statement_merge_lists, id: :uuid do |t|
create_table :series_statement_merge_lists do |t|
t.string :title

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateSeriesStatementMerges < ActiveRecord::Migration[5.2]
def change
create_table :series_statement_merges do |t|
t.references :series_statement, foreign_key: true, null: false, type: :uuid
t.references :series_statement_merge_list, foreign_key: true, index: false, null: false, type: :uuid
t.references :series_statement, foreign_key: true, null: false
t.references :series_statement_merge_list, foreign_key: true, index: false, null: false

t.timestamps
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class AddManifestaitonIdToSeriesStatement < ActiveRecord::Migration[5.2]
def change
add_reference :series_statements, :manifestation, foreign_key: true, type: :uuid
add_reference :series_statements, :manifestation, foreign_key: true
end
end
6 changes: 3 additions & 3 deletions spec/dummy/db/migrate/20120319173203_create_accepts.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class CreateAccepts < ActiveRecord::Migration[5.2]
def change
create_table :accepts, id: :uuid do |t|
t.references :basket, foreign_key: true, type: :uuid
t.references :item, type: :uuid
create_table :accepts do |t|
t.references :basket, foreign_key: true
t.references :item
t.references :librarian, foreign_key: {to_table: :users}

t.timestamps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class AddRootManifestationIdToSeriesStatement < ActiveRecord::Migration[5.2]
def change
add_reference :series_statements, :root_manifestation, foreign_ley: {to_table: :manifestations}, type: :uuid
add_reference :series_statements, :root_manifestation, foreign_ley: {to_table: :manifestations}
end
end
2 changes: 1 addition & 1 deletion spec/dummy/db/migrate/20130506175834_create_identifiers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def change
create_table :identifiers do |t|
t.string :body, null: false, index: true
t.references :identifier_type, foreign_key: true, null: false
t.references :manifestation, foreign_key: true, null: false, type: :uuid
t.references :manifestation, foreign_key: true, null: false
t.boolean :primary
t.integer :position

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, id: :uuid do |t|
create_table :user_import_files 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, id: :uuid do |t|
t.references :user_import_file, foreign_key: true, type: :uuid
create_table :user_import_results do |t|
t.references :user_import_file, foreign_key: true
t.references :user, foreign_key: true
t.text :body

Expand Down
Loading

0 comments on commit 9fdbf7a

Please sign in to comment.