NoMethodError: undefined method 'add_column'

This commit is contained in:
Karel Pičman 2023-05-15 12:05:46 +02:00
parent 66057973ac
commit b07ec0662d
6 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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|