This commit is contained in:
parent
19a8232c17
commit
13d2de6661
@ -26,7 +26,7 @@ class CreateDmsfWorkflows < ActiveRecord::Migration
|
||||
t.string :name, null: false
|
||||
t.references :project
|
||||
end
|
||||
add_index :dmsf_workflows, [:name], unique: true, name: :index_dmsf_workflows_on_name
|
||||
add_index :dmsf_workflows, [:name], unique: true
|
||||
|
||||
change_table :dmsf_file_revisions do |t|
|
||||
t.references :dmsf_workflow
|
||||
|
||||
@ -27,7 +27,7 @@ class CreateDmsfWorkflowSteps < ActiveRecord::Migration
|
||||
t.references :user, null: false
|
||||
t.integer :operator, null: false
|
||||
end
|
||||
add_index :dmsf_workflow_steps, :dmsf_workflow_id, name: :index_dmsf_workflow_steps_on_dmsf_workflow_id
|
||||
add_index :dmsf_workflow_steps, :dmsf_workflow_id
|
||||
end
|
||||
|
||||
end
|
||||
@ -21,7 +21,7 @@
|
||||
class AddIndexToDmsfFiles < ActiveRecord::Migration
|
||||
|
||||
def change
|
||||
add_index :dmsf_files, :project_id, name: :index_dmsf_files_on_project_id
|
||||
add_index :dmsf_files, :project_id
|
||||
end
|
||||
|
||||
end
|
||||
@ -21,7 +21,7 @@
|
||||
class AddIndexToDmsfFolders < ActiveRecord::Migration
|
||||
|
||||
def change
|
||||
add_index :dmsf_folders, :project_id, name: :index_dmsf_folders_on_project_id
|
||||
add_index :dmsf_folders, :project_id
|
||||
end
|
||||
|
||||
end
|
||||
@ -21,7 +21,7 @@
|
||||
class AddIndexToDmsfFileRevision < ActiveRecord::Migration
|
||||
|
||||
def change
|
||||
add_index :dmsf_file_revisions, :dmsf_file_id, name: :index_dmsf_file_revisions_on_dmsf_file_id
|
||||
add_index :dmsf_file_revisions, :dmsf_file_id
|
||||
end
|
||||
|
||||
end
|
||||
@ -21,7 +21,7 @@
|
||||
class AddIndexToDmsfLock < ActiveRecord::Migration
|
||||
|
||||
def change
|
||||
add_index :dmsf_locks, :entity_id, name: :index_dmsf_locks_on_entity_id
|
||||
add_index :dmsf_locks, :entity_id
|
||||
end
|
||||
|
||||
end
|
||||
@ -32,7 +32,7 @@ class CreateDmsfLinks < ActiveRecord::Migration
|
||||
t.integer :deleted_by_user_id
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :dmsf_links, :project_id, name: :index_dmsf_links_on_project_id
|
||||
add_index :dmsf_links, :project_id
|
||||
end
|
||||
|
||||
end
|
||||
@ -28,7 +28,7 @@ class CreateDmsfPublicUrls < ActiveRecord::Migration
|
||||
t.datetime :expire_at, null: false
|
||||
t.timestamps
|
||||
end
|
||||
add_index :dmsf_public_urls, :token, name: :index_dmsf_public_urls_on_token
|
||||
add_index :dmsf_public_urls, :token
|
||||
end
|
||||
|
||||
end
|
||||
@ -26,14 +26,14 @@ class DmsfFileContainer < ActiveRecord::Migration
|
||||
add_column :dmsf_files, :container_type, :string, limit: 30, null: false,
|
||||
default: 'Project'
|
||||
DmsfFile.update_all container_type: 'Project'
|
||||
add_index :dmsf_files, [:container_id, :container_type], name: :index_dmsf_files_on_container_id_container_type
|
||||
add_index :dmsf_files, [:container_id, :container_type]
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :dmsf_files, [:container_id, :container_type]
|
||||
remove_column :dmsf_files, :container_type
|
||||
rename_column :dmsf_files, :container_id, :project_id
|
||||
add_index :dmsf_files, :project_id, name: :index_dmsf_files_on_project_id
|
||||
add_index :dmsf_files, :project_id
|
||||
end
|
||||
|
||||
end
|
||||
@ -26,7 +26,7 @@ class CreateDmsfFolderPermissions < ActiveRecord::Migration
|
||||
t.integer :object_id, null: false
|
||||
t.string :object_type, limit: 30, null: false
|
||||
end
|
||||
add_index :dmsf_folder_permissions, :dmsf_folder_id, name: :index_dmsf_folder_permissions_on_dmsf_folder_id
|
||||
add_index :dmsf_folder_permissions, :dmsf_folder_id
|
||||
end
|
||||
|
||||
end
|
||||
@ -63,7 +63,7 @@ class DmsfFileContainerRollback < ActiveRecord::Migration
|
||||
remove_index :dmsf_files, [:container_id, :container_type]
|
||||
remove_column :dmsf_files, :container_type
|
||||
rename_column :dmsf_files, :container_id, :project_id
|
||||
add_index :dmsf_files, :project_id, name: :index_dmsf_files_on_project_id
|
||||
add_index :dmsf_files, :project_id
|
||||
# Initialize system folder_flag to dmsf_folders
|
||||
DmsfFolder.where(id: new_folder_ids).update_all(system: true)
|
||||
end
|
||||
@ -88,7 +88,7 @@ class DmsfFileContainerRollback < ActiveRecord::Migration
|
||||
end
|
||||
end
|
||||
remove_column :dmsf_files, :project_id # temporarily added for the save method
|
||||
add_index :dmsf_files, [:container_id, :container_type], name: :index_dmsf_files_on_container_id_container_type
|
||||
add_index :dmsf_files, [:container_id, :container_type]
|
||||
# dmsf_folders
|
||||
DmsfFolder.where(system: true).delete_all
|
||||
remove_column :dmsf_folders, :system
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
class AddIndexToDmsfFolder < ActiveRecord::Migration
|
||||
|
||||
def change
|
||||
add_index :dmsf_folders, :dmsf_folder_id, name: :index_dmsf_folders_on_dmsf_folder_id
|
||||
add_index :dmsf_folders, :dmsf_folder_id
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user