NoMethodError: undefined method 'rename_table'
This commit is contained in:
parent
db1dc803d3
commit
765bd6ec10
@ -73,8 +73,8 @@ class Dmsf144 < ActiveRecord::Migration[4.2]
|
|||||||
# Data cleanup
|
# Data cleanup
|
||||||
t.rename :dmsf_file_id, :entity_id
|
t.rename :dmsf_file_id, :entity_id
|
||||||
t.remove :locked
|
t.remove :locked
|
||||||
t.rename_table :dmsf_locks
|
|
||||||
end
|
end
|
||||||
|
rename_table :dmsf_file_locks, :dmsf_locks
|
||||||
# Not sure if this is the right place to do this, as its file manipulation, not database (strictly)
|
# Not sure if this is the right place to do this, as its file manipulation, not database (strictly)
|
||||||
say 'Completing one-time file migration ...'
|
say 'Completing one-time file migration ...'
|
||||||
begin
|
begin
|
||||||
@ -109,7 +109,7 @@ class Dmsf144 < ActiveRecord::Migration[4.2]
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.down
|
def down
|
||||||
rename_table :dmsf_locks, :dmsf_file_locks
|
rename_table :dmsf_locks, :dmsf_file_locks
|
||||||
add_column :dmsf_file_locks, :locked, :boolean, default: false, null: false
|
add_column :dmsf_file_locks, :locked, :boolean, default: false, null: false
|
||||||
# Data cleanup - delete all expired locks, or any folder locks
|
# Data cleanup - delete all expired locks, or any folder locks
|
||||||
@ -119,7 +119,7 @@ class Dmsf144 < ActiveRecord::Migration[4.2]
|
|||||||
say 'Changing all records to be locked'
|
say 'Changing all records to be locked'
|
||||||
DmsfFileLock.update_all locked: true
|
DmsfFileLock.update_all locked: true
|
||||||
change_table :dmsf_file_locks, bulk: true do |t|
|
change_table :dmsf_file_locks, bulk: true do |t|
|
||||||
t.rename_column :entity_id, :dmsf_file_id
|
t.rename :entity_id, :dmsf_file_id
|
||||||
t.remove :entity_type
|
t.remove :entity_type
|
||||||
t.remove :lock_type_cd
|
t.remove :lock_type_cd
|
||||||
t.remove :lock_scope_cd
|
t.remove :lock_scope_cd
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class DmsfFileContainer < ActiveRecord::Migration[4.2]
|
|||||||
def up
|
def up
|
||||||
change_table :dmsf_files, bulk: true do |t|
|
change_table :dmsf_files, bulk: true do |t|
|
||||||
t.remove_index :project_id
|
t.remove_index :project_id
|
||||||
t.rename_column :project_id, :container_id
|
t.rename :project_id, :container_id
|
||||||
t.column :container_type, :string, limit: 30, null: false, default: 'Project'
|
t.column :container_type, :string, limit: 30, null: false, default: 'Project'
|
||||||
t.index %i[container_id container_type]
|
t.index %i[container_id container_type]
|
||||||
end
|
end
|
||||||
@ -34,7 +34,7 @@ class DmsfFileContainer < ActiveRecord::Migration[4.2]
|
|||||||
change_table :dmsf_files, bulk: true do |t|
|
change_table :dmsf_files, bulk: true do |t|
|
||||||
t.remove_index %i[container_id container_type]
|
t.remove_index %i[container_id container_type]
|
||||||
t.remove :container_type
|
t.remove :container_type
|
||||||
t.rename_column :container_id, :project_id
|
t.rename :container_id, :project_id
|
||||||
t.index :project_id
|
t.index :project_id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class DmsfFileContainerRollback < ActiveRecord::Migration[4.2]
|
|||||||
change_table :dmsf_files, bulk: true do |t|
|
change_table :dmsf_files, bulk: true do |t|
|
||||||
t.remove_index %i[container_id container_type]
|
t.remove_index %i[container_id container_type]
|
||||||
t.remove :container_type
|
t.remove :container_type
|
||||||
t.rename_column :container_id, :project_id
|
t.rename :container_id, :project_id
|
||||||
t.index :project_id
|
t.index :project_id
|
||||||
end
|
end
|
||||||
# Initialize system folder_flag to dmsf_folders
|
# Initialize system folder_flag to dmsf_folders
|
||||||
@ -81,7 +81,7 @@ class DmsfFileContainerRollback < ActiveRecord::Migration[4.2]
|
|||||||
)
|
)
|
||||||
change_table :dmsf_files, bulk: true do |t|
|
change_table :dmsf_files, bulk: true do |t|
|
||||||
t.remove_index(:project_id) if t.index_exists?(:project_id)
|
t.remove_index(:project_id) if t.index_exists?(:project_id)
|
||||||
t.rename_column :project_id, :container_id
|
t.rename :project_id, :container_id
|
||||||
# Temporarily added for the save method
|
# Temporarily added for the save method
|
||||||
t.column :project_id, :int, null: true
|
t.column :project_id, :int, null: true
|
||||||
t.column :container_type, :string, limit: 30, null: false, default: 'Project'
|
t.column :container_type, :string, limit: 30, null: false, default: 'Project'
|
||||||
|
|||||||
@ -22,8 +22,8 @@
|
|||||||
class WorkflowStartedBy < ActiveRecord::Migration[5.2]
|
class WorkflowStartedBy < ActiveRecord::Migration[5.2]
|
||||||
def change
|
def change
|
||||||
change_table :dmsf_file_revisions, bulk: true do |t|
|
change_table :dmsf_file_revisions, bulk: true do |t|
|
||||||
t.rename_column :dmsf_workflow_assigned_by, :dmsf_workflow_assigned_by_user_id
|
t.rename :dmsf_workflow_assigned_by, :dmsf_workflow_assigned_by_user_id
|
||||||
t.rename_column :dmsf_workflow_started_by, :dmsf_workflow_started_by_user_id
|
t.rename :dmsf_workflow_started_by, :dmsf_workflow_started_by_user_id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user