From 765bd6ec10645f7b88082debf9584a693b7e36fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Mon, 15 May 2023 12:28:37 +0200 Subject: [PATCH] NoMethodError: undefined method 'rename_table' --- db/migrate/07_dmsf_1_4_4.rb | 6 +++--- db/migrate/20170118142001_dmsf_file_container.rb | 4 ++-- db/migrate/20170421101901_dmsf_file_container_rollback.rb | 4 ++-- db/migrate/20192703123101_workflow_started_by.rb | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/db/migrate/07_dmsf_1_4_4.rb b/db/migrate/07_dmsf_1_4_4.rb index 26e98d75..efe3e941 100644 --- a/db/migrate/07_dmsf_1_4_4.rb +++ b/db/migrate/07_dmsf_1_4_4.rb @@ -73,8 +73,8 @@ class Dmsf144 < ActiveRecord::Migration[4.2] # Data cleanup t.rename :dmsf_file_id, :entity_id t.remove :locked - t.rename_table :dmsf_locks 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) say 'Completing one-time file migration ...' begin @@ -109,7 +109,7 @@ class Dmsf144 < ActiveRecord::Migration[4.2] end end - def self.down + def down rename_table :dmsf_locks, :dmsf_file_locks add_column :dmsf_file_locks, :locked, :boolean, default: false, null: false # 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' DmsfFileLock.update_all locked: true 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 :lock_type_cd t.remove :lock_scope_cd diff --git a/db/migrate/20170118142001_dmsf_file_container.rb b/db/migrate/20170118142001_dmsf_file_container.rb index 9aab06f9..4bb02007 100644 --- a/db/migrate/20170118142001_dmsf_file_container.rb +++ b/db/migrate/20170118142001_dmsf_file_container.rb @@ -23,7 +23,7 @@ class DmsfFileContainer < ActiveRecord::Migration[4.2] def up change_table :dmsf_files, bulk: true do |t| 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.index %i[container_id container_type] end @@ -34,7 +34,7 @@ class DmsfFileContainer < ActiveRecord::Migration[4.2] change_table :dmsf_files, bulk: true do |t| t.remove_index %i[container_id container_type] t.remove :container_type - t.rename_column :container_id, :project_id + t.rename :container_id, :project_id t.index :project_id end end diff --git a/db/migrate/20170421101901_dmsf_file_container_rollback.rb b/db/migrate/20170421101901_dmsf_file_container_rollback.rb index 329c8fdc..4ac7f14b 100644 --- a/db/migrate/20170421101901_dmsf_file_container_rollback.rb +++ b/db/migrate/20170421101901_dmsf_file_container_rollback.rb @@ -67,7 +67,7 @@ class DmsfFileContainerRollback < ActiveRecord::Migration[4.2] change_table :dmsf_files, bulk: true do |t| t.remove_index %i[container_id container_type] t.remove :container_type - t.rename_column :container_id, :project_id + t.rename :container_id, :project_id t.index :project_id end # 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| 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 t.column :project_id, :int, null: true t.column :container_type, :string, limit: 30, null: false, default: 'Project' diff --git a/db/migrate/20192703123101_workflow_started_by.rb b/db/migrate/20192703123101_workflow_started_by.rb index 6735d689..00f7afac 100644 --- a/db/migrate/20192703123101_workflow_started_by.rb +++ b/db/migrate/20192703123101_workflow_started_by.rb @@ -22,8 +22,8 @@ class WorkflowStartedBy < ActiveRecord::Migration[5.2] def change change_table :dmsf_file_revisions, bulk: true do |t| - t.rename_column :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_assigned_by, :dmsf_workflow_assigned_by_user_id + t.rename :dmsf_workflow_started_by, :dmsf_workflow_started_by_user_id end end end