forked from masao/enju_loc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
202 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
class CreateShelves < ActiveRecord::Migration | ||
def change | ||
create_table :shelves do |t| | ||
t.string :name, :null => false | ||
t.string :name, null: false | ||
t.text :display_name | ||
t.text :note | ||
t.integer :library_id, :default => 1, :null => false | ||
t.integer :items_count, :default => 0, :null => false | ||
t.references :library, index: true, null: false | ||
t.integer :items_count, default: 0, null: false | ||
t.integer :position | ||
t.timestamps | ||
t.datetime :deleted_at | ||
end | ||
add_index :shelves, :library_id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
class CreateBaskets < ActiveRecord::Migration | ||
def change | ||
create_table :baskets do |t| | ||
t.integer :user_id | ||
t.references :user, index: true | ||
t.text :note | ||
t.integer :lock_version, :default => 0, :null => false | ||
t.integer :lock_version, default: 0, null: false | ||
|
||
t.timestamps | ||
end | ||
add_index :baskets, :user_id | ||
end | ||
end |
11 changes: 4 additions & 7 deletions
11
spec/dummy/db/migrate/20081006090811_create_subscriptions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
class CreateSubscriptions < ActiveRecord::Migration | ||
def change | ||
create_table :subscriptions do |t| | ||
t.text :title, :null => false | ||
t.text :title, null: false | ||
t.text :note | ||
#t.integer :subscription_list_id, :integer | ||
t.integer :user_id | ||
t.integer :order_list_id | ||
t.references :user, index: true | ||
t.references :order_list, index: true | ||
t.datetime :deleted_at | ||
t.integer :subscribes_count, :default => 0, :null => false | ||
t.integer :subscribes_count, default: 0, null: false | ||
|
||
t.timestamps | ||
end | ||
add_index :subscriptions, :user_id | ||
add_index :subscriptions, :order_list_id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
class CreateSubscribes < ActiveRecord::Migration | ||
def change | ||
create_table :subscribes do |t| | ||
t.integer :subscription_id, :null => false | ||
t.integer :work_id, :null => false | ||
t.datetime :start_at, :null => false | ||
t.datetime :end_at, :null => false | ||
t.references :subscription, index: true, null: false | ||
t.integer :work_id, null: false | ||
t.datetime :start_at, null: false | ||
t.datetime :end_at, null: false | ||
|
||
t.timestamps | ||
end | ||
add_index :subscribes, :subscription_id | ||
add_index :subscribes, :work_id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
class CreateAccepts < ActiveRecord::Migration | ||
def change | ||
create_table :accepts do |t| | ||
t.integer :basket_id | ||
t.integer :item_id | ||
t.integer :librarian_id | ||
t.references :basket, index: true | ||
t.references :item, index: true | ||
t.references :librarian, index: true | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :accepts, :basket_id | ||
add_index :accepts, :item_id | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
spec/dummy/db/migrate/20140110122216_create_user_import_files.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
spec/dummy/db/migrate/20140110131010_create_user_import_results.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
spec/dummy/db/migrate/20140709113413_create_user_export_files.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class AddDefaultLibraryIdToUserImportFile < ActiveRecord::Migration | ||
def change | ||
add_column :user_import_files, :default_library_id, :integer | ||
add_reference :user_import_files, :default_library | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class AddDefaultUserGroupIdToUserImportFile < ActiveRecord::Migration | ||
def change | ||
add_column :user_import_files, :default_user_group_id, :integer | ||
add_reference :user_import_files, :default_user_group | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
class CreateColors < ActiveRecord::Migration | ||
def change | ||
create_table :colors do |t| | ||
t.integer :library_group_id | ||
t.references :library_group, index: true | ||
t.string :property | ||
t.string :code | ||
t.integer :position | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :colors, :library_group_id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
class CreateWithdraws < ActiveRecord::Migration | ||
def change | ||
create_table :withdraws do |t| | ||
t.integer :basket_id | ||
t.integer :item_id | ||
t.integer :librarian_id | ||
t.references :basket, index: true | ||
t.references :item, index: true | ||
t.references :librarian, index: true | ||
|
||
t.timestamps null: false | ||
end | ||
add_index :withdraws, :basket_id | ||
add_index :withdraws, :item_id | ||
end | ||
end |
25 changes: 19 additions & 6 deletions
25
spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
# This migration comes from enju_library_engine (originally 20151213070943) | ||
class AddTranslationTableToLibraryGroup < ActiveRecord::Migration | ||
def up | ||
LibraryGroup.create_translation_table!({ | ||
login_banner: :text | ||
}, { | ||
migrate_data: true | ||
}) | ||
if defined?(Globalize) | ||
LibraryGroup.create_translation_table!({ | ||
login_banner: :text | ||
}, { | ||
migrate_data: true | ||
}) | ||
end | ||
|
||
if defined?(AwesomeHstoreTranslate) | ||
add_column :library_groups, :login_banner, :hstore | ||
end | ||
end | ||
|
||
def down | ||
LibraryGroup.drop_translation_table! migrate_data: true | ||
if defined?(Globalize) | ||
LibraryGroup.drop_translation_table! migrate_data: true | ||
end | ||
|
||
if defined?(AwesomeHstoreTranslate) | ||
remove_column :library_groups, :login_banner | ||
end | ||
end | ||
end |
17 changes: 15 additions & 2 deletions
17
spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
# This migration comes from enju_library_engine (originally 20151213072705) | ||
class AddFooterBannerToLibraryGroup < ActiveRecord::Migration | ||
def up | ||
LibraryGroup.add_translation_fields! footer_banner: :text | ||
if defined?(Globalize) | ||
LibraryGroup.add_translation_fields! footer_banner: :text | ||
end | ||
|
||
if defined?(AwesomeHstoreTranslate) | ||
add_column :library_groups, :footer_banner, :hstore | ||
end | ||
end | ||
|
||
def down | ||
remove_column :library_group_translations, :footer_banner | ||
if defined?(Globalize) | ||
remove_column :library_group_translations, :footer_banner | ||
end | ||
|
||
if defined?(AwesomeHstoreTranslate) | ||
remove_column :library_groups, :footer_banner | ||
end | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddCsvCharsetConversionToLibraryGroup < ActiveRecord::Migration | ||
def change | ||
add_column :library_groups, :csv_charset_conversion, :boolean, null: false, default: false | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddHeaderLogoToLibraryGroup < ActiveRecord::Migration | ||
def change | ||
add_attachment :library_groups, :header_logo | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class SetNotNullToManifestationIdOnItems < ActiveRecord::Migration | ||
def change | ||
change_column_null :items, :manifestation_id, false | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration | ||
def change | ||
add_column :library_groups, :header_logo_meta, :text | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
...migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration | ||
disable_ddl_transaction! | ||
|
||
def up | ||
add_index :user_import_file_transitions, [:user_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_import_file_transitions_parent_most_recent" #, algorithm: :concurrently | ||
change_column_null :user_import_file_transitions, :most_recent, false | ||
end | ||
|
||
def down | ||
remove_index :user_import_file_transitions, name: "index_user_import_file_transitions_parent_most_recent" | ||
change_column_null :user_import_file_transitions, :most_recent, true | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
...migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration | ||
disable_ddl_transaction! | ||
|
||
def up | ||
add_index :user_export_file_transitions, [:user_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_export_file_transitions_parent_most_recent" #, algorithm: :concurrently | ||
change_column_null :user_export_file_transitions, :most_recent, false | ||
end | ||
|
||
def down | ||
remove_index :user_export_file_transitions, name: "index_user_export_file_transitions_parent_most_recent" | ||
change_column_null :user_export_file_transitions, :most_recent, true | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
...igrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Migration | ||
disable_ddl_transaction! | ||
|
||
def up | ||
add_index :agent_import_file_transitions, [:agent_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_agent_import_file_transitions_parent_most_recent" #, algorithm: :concurrently | ||
change_column_null :agent_import_file_transitions, :most_recent, false | ||
end | ||
|
||
def down | ||
remove_index :agent_import_file_transitions, name: "index_agent_import_file_transitions_parent_most_recent" | ||
change_column_null :agent_import_file_transitions, :most_recent, true | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
...ate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord::Migration | ||
disable_ddl_transaction! | ||
|
||
def up | ||
add_index :resource_import_file_transitions, [:resource_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_resource_import_file_transitions_parent_most_recent" #, algorithm: :concurrently | ||
change_column_null :resource_import_file_transitions, :most_recent, false | ||
end | ||
|
||
def down | ||
remove_index :resource_import_file_transitions, name: "index_resource_import_file_transitions_parent_most_recent" | ||
change_column_null :resource_import_file_transitions, :most_recent, true | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
...ate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord::Migration | ||
disable_ddl_transaction! | ||
|
||
def up | ||
add_index :resource_export_file_transitions, [:resource_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_resource_export_file_transitions_parent_most_recent" #, algorithm: :concurrently | ||
change_column_null :resource_export_file_transitions, :most_recent, false | ||
end | ||
|
||
def down | ||
remove_index :resource_export_file_transitions, name: "index_resource_export_file_transitions_parent_most_recent" | ||
change_column_null :resource_export_file_transitions, :most_recent, true | ||
end | ||
end |
Oops, something went wrong.