diff --git a/db/migrate/07_dmsf_1_4_4.rb b/db/migrate/07_dmsf_1_4_4.rb index 67cc1dd4..26e98d75 100644 --- a/db/migrate/07_dmsf_1_4_4.rb +++ b/db/migrate/07_dmsf_1_4_4.rb @@ -67,12 +67,12 @@ class Dmsf144 < ActiveRecord::Migration[4.2] DmsfFileLock.update_all entity_type: 0, lock_type_cd: 0, lock_scope_cd: 0 change_table :dmsf_file_locks, bulk: true do |t| # These are not null-allowed columns - t.change_column :entity_type, :integer, null: false - t.change_column :lock_type_cd, :integer, null: false - t.change_column :lock_scope_cd, :integer, null: false + t.change :entity_type, :integer, null: false + t.change :lock_type_cd, :integer, null: false + t.change :lock_scope_cd, :integer, null: false # Data cleanup - t.rename_column :dmsf_file_id, :entity_id - t.remove_column :locked + t.rename :dmsf_file_id, :entity_id + t.remove :locked t.rename_table :dmsf_locks end # Not sure if this is the right place to do this, as its file manipulation, not database (strictly) @@ -120,11 +120,11 @@ class Dmsf144 < ActiveRecord::Migration[4.2] DmsfFileLock.update_all locked: true change_table :dmsf_file_locks, bulk: true do |t| t.rename_column :entity_id, :dmsf_file_id - t.remove_column :entity_type - t.remove_column :lock_type_cd - t.remove_column :lock_scope_cd - t.remove_column :expires_at - t.remove_column :uuid + t.remove :entity_type + t.remove :lock_type_cd + t.remove :lock_scope_cd + t.remove :expires_at + t.remove :uuid end # Not sure if this is the right place to do this, as its file manipulation, not database (stricly) begin diff --git a/db/migrate/20120822100401_create_dmsf_workflows.rb b/db/migrate/20120822100401_create_dmsf_workflows.rb index a1f65c79..8aa78207 100644 --- a/db/migrate/20120822100401_create_dmsf_workflows.rb +++ b/db/migrate/20120822100401_create_dmsf_workflows.rb @@ -39,11 +39,11 @@ class CreateDmsfWorkflows < ActiveRecord::Migration[4.2] def down change_table :dmsf_file_revisions, bulk: true do |t| - t.remove_column :dmsf_workflow_id - t.remove_column :dmsf_workflow_assigned_by - t.remove_column :dmsf_workflow_assigned_at - t.remove_column :dmsf_workflow_started_by - t.remove_column :dmsf_workflow_started_at + t.remove :dmsf_workflow_id + t.remove :dmsf_workflow_assigned_by + t.remove :dmsf_workflow_assigned_at + t.remove :dmsf_workflow_started_by + t.remove :dmsf_workflow_started_at end drop_table :dmsf_workflows end diff --git a/db/migrate/20140519133201_trash_bin.rb b/db/migrate/20140519133201_trash_bin.rb index 23351dd7..87851825 100644 --- a/db/migrate/20140519133201_trash_bin.rb +++ b/db/migrate/20140519133201_trash_bin.rb @@ -32,8 +32,8 @@ class TrashBin < ActiveRecord::Migration[4.2] def down change_table :dmsf_folders, bulk: true do |t| - t.remove_column :deleted - t.remove_column :deleted_by_user_id + t.remove :deleted + t.remove :deleted_by_user_id end end end diff --git a/db/migrate/20150130052716_add_external.rb b/db/migrate/20150130052716_add_external.rb index 4467633f..0564c790 100644 --- a/db/migrate/20150130052716_add_external.rb +++ b/db/migrate/20150130052716_add_external.rb @@ -22,7 +22,7 @@ class AddExternal < ActiveRecord::Migration[4.2] def up change_table :dmsf_links, bulk: true do |t| - t.change_column :target_id, :integer, null: true + t.change :target_id, :integer, null: true t.column :external_url, :string, null: true end end diff --git a/db/migrate/20160222140401_approval_workflow_std_fields.rb b/db/migrate/20160222140401_approval_workflow_std_fields.rb index d2428181..7396fa37 100644 --- a/db/migrate/20160222140401_approval_workflow_std_fields.rb +++ b/db/migrate/20160222140401_approval_workflow_std_fields.rb @@ -36,9 +36,9 @@ class ApprovalWorkflowStdFields < ActiveRecord::Migration[4.2] def down change_table :dmsf_workflows, bulk: true do |t| - t.remove_column :updated_on - t.remove_column :created_on - t.remove_column :author_id + t.remove :updated_on + t.remove :created_on + t.remove :author_id end end end diff --git a/db/migrate/20170118142001_dmsf_file_container.rb b/db/migrate/20170118142001_dmsf_file_container.rb index a02ddb6c..9aab06f9 100644 --- a/db/migrate/20170118142001_dmsf_file_container.rb +++ b/db/migrate/20170118142001_dmsf_file_container.rb @@ -25,7 +25,7 @@ class DmsfFileContainer < ActiveRecord::Migration[4.2] t.remove_index :project_id t.rename_column :project_id, :container_id t.column :container_type, :string, limit: 30, null: false, default: 'Project' - t.add_index %i[container_id container_type] + t.index %i[container_id container_type] end DmsfFile.update_all container_type: 'Project' end @@ -33,9 +33,9 @@ class DmsfFileContainer < ActiveRecord::Migration[4.2] def down change_table :dmsf_files, bulk: true do |t| t.remove_index %i[container_id container_type] - t.remove_column :container_type + t.remove :container_type t.rename_column :container_id, :project_id - t.add_index :project_id + t.index :project_id end end end diff --git a/db/migrate/20170421101901_dmsf_file_container_rollback.rb b/db/migrate/20170421101901_dmsf_file_container_rollback.rb index 9224d74f..329c8fdc 100644 --- a/db/migrate/20170421101901_dmsf_file_container_rollback.rb +++ b/db/migrate/20170421101901_dmsf_file_container_rollback.rb @@ -66,9 +66,9 @@ class DmsfFileContainerRollback < ActiveRecord::Migration[4.2] # Make DB changes in dmsf_files change_table :dmsf_files, bulk: true do |t| t.remove_index %i[container_id container_type] - t.remove_column :container_type + t.remove :container_type t.rename_column :container_id, :project_id - t.add_index :project_id + t.index :project_id end # Initialize system folder_flag to dmsf_folders DmsfFolder.where(id: new_folder_ids).update_all system: true @@ -96,8 +96,8 @@ class DmsfFileContainerRollback < ActiveRecord::Migration[4.2] file.save! end change_table :dmsf_files, bulk: true do |t| - t.remove_column :project_id # temporarily added for the save method - t.add_index(%i[container_id container_type]) unless t.index_exists?(%i[container_id container_type]) + t.remove :project_id # temporarily added for the save method + t.index(%i[container_id container_type]) unless t.index_exists?(%i[container_id container_type]) end # dmsf_folders DmsfFolder.where(system: true).delete_all diff --git a/db/migrate/20200813075501_change_index_in_dmsf_locks.rb b/db/migrate/20200813075501_change_index_in_dmsf_locks.rb index 3dd451cd..7a9b7535 100644 --- a/db/migrate/20200813075501_change_index_in_dmsf_locks.rb +++ b/db/migrate/20200813075501_change_index_in_dmsf_locks.rb @@ -23,14 +23,14 @@ class ChangeIndexInDmsfLocks < ActiveRecord::Migration[5.2] def up change_table :dmsf_locks, bulk: true do |t| t.remove_index :entity_id - t.add_index %i[entity_id entity_type] + t.index %i[entity_id entity_type] end end def down change_table :dmsf_locks, bulk: true do |t| t.remove_index %i[entity_id entity_type] - t.add_index :entity_id + t.index :entity_id end end end