From b07ec0662d2b7f949e7b9b2240c13074da13b97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Mon, 15 May 2023 12:05:46 +0200 Subject: [PATCH] NoMethodError: undefined method 'add_column' --- db/migrate/07_dmsf_1_4_4.rb | 10 +++++----- db/migrate/20140519133201_trash_bin.rb | 4 ++-- db/migrate/20150130052716_add_external.rb | 2 +- .../20160222140401_approval_workflow_std_fields.rb | 6 +++--- db/migrate/20170118142001_dmsf_file_container.rb | 2 +- .../20170421101901_dmsf_file_container_rollback.rb | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/db/migrate/07_dmsf_1_4_4.rb b/db/migrate/07_dmsf_1_4_4.rb index fc43ff9b..67cc1dd4 100644 --- a/db/migrate/07_dmsf_1_4_4.rb +++ b/db/migrate/07_dmsf_1_4_4.rb @@ -32,13 +32,13 @@ class Dmsf144 < ActiveRecord::Migration[4.2] def up change_table :dmsf_file_locks, bulk: true do |t| # Add our entity_type column (used with our entity type) - t.add_column :entity_type, :integer, null: true + t.column :entity_type, :integer, null: true # Add our lock relevent columns (ENUM) - null (till we upgrade data) - t.add_column :lock_type_cd, :integer, null: true - t.add_column :lock_scope_cd, :integer, null: true - t.add_column :uuid, :string, null: true, limit: 36 + t.column :lock_type_cd, :integer, null: true + t.column :lock_scope_cd, :integer, null: true + t.column :uuid, :string, null: true, limit: 36 # Add our expires_at column - t.add_column :expires_at, :datetime, null: true + t.column :expires_at, :datetime, null: true end do_not_delete = [] # - 2012-07-12: Better compatibility for postgres - query used 3 columns however diff --git a/db/migrate/20140519133201_trash_bin.rb b/db/migrate/20140519133201_trash_bin.rb index b1f7826f..23351dd7 100644 --- a/db/migrate/20140519133201_trash_bin.rb +++ b/db/migrate/20140519133201_trash_bin.rb @@ -23,8 +23,8 @@ class TrashBin < ActiveRecord::Migration[4.2] def up # DMSF - project's root folder notification change_table :dmsf_folders, bulk: true do |t| - t.add_column :deleted, :boolean, default: false, null: false - t.add_column :deleted_by_user_id, :integer + t.column :deleted, :boolean, default: false, null: false + t.column :deleted_by_user_id, :integer end DmsfFolder.reset_column_information DmsfFolder.update_all deleted: false diff --git a/db/migrate/20150130052716_add_external.rb b/db/migrate/20150130052716_add_external.rb index 6fa83177..4467633f 100644 --- a/db/migrate/20150130052716_add_external.rb +++ b/db/migrate/20150130052716_add_external.rb @@ -23,7 +23,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.add_column :external_url, :string, 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 e10d33c8..d2428181 100644 --- a/db/migrate/20160222140401_approval_workflow_std_fields.rb +++ b/db/migrate/20160222140401_approval_workflow_std_fields.rb @@ -22,9 +22,9 @@ class ApprovalWorkflowStdFields < ActiveRecord::Migration[4.2] def up change_table :dmsf_workflows, bulk: true do |t| - t.add_column :updated_on, :timestamp - t.add_column :created_on, :datetime - t.add_column :author_id, :integer + t.column :updated_on, :timestamp + t.column :created_on, :datetime + t.column :author_id, :integer end DmsfWorkflow.reset_column_information # Set updated_on diff --git a/db/migrate/20170118142001_dmsf_file_container.rb b/db/migrate/20170118142001_dmsf_file_container.rb index fabfa56a..a02ddb6c 100644 --- a/db/migrate/20170118142001_dmsf_file_container.rb +++ b/db/migrate/20170118142001_dmsf_file_container.rb @@ -24,7 +24,7 @@ class DmsfFileContainer < ActiveRecord::Migration[4.2] change_table :dmsf_files, bulk: true do |t| t.remove_index :project_id t.rename_column :project_id, :container_id - t.add_column :container_type, :string, limit: 30, null: false, default: 'Project' + t.column :container_type, :string, limit: 30, null: false, default: 'Project' t.add_index %i[container_id container_type] end DmsfFile.update_all container_type: 'Project' diff --git a/db/migrate/20170421101901_dmsf_file_container_rollback.rb b/db/migrate/20170421101901_dmsf_file_container_rollback.rb index face312d..9224d74f 100644 --- a/db/migrate/20170421101901_dmsf_file_container_rollback.rb +++ b/db/migrate/20170421101901_dmsf_file_container_rollback.rb @@ -83,8 +83,8 @@ class DmsfFileContainerRollback < ActiveRecord::Migration[4.2] t.remove_index(:project_id) if t.index_exists?(:project_id) t.rename_column :project_id, :container_id # Temporarily added for the save method - t.add_column :project_id, :int, null: true - t.add_column :container_type, :string, limit: 30, null: false, default: 'Project' + t.column :project_id, :int, null: true + t.column :container_type, :string, limit: 30, null: false, default: 'Project' end DmsfFile.update_all container_type: 'Project' file_folder_ids.each do |id, title|