SQL server compatibility

This commit is contained in:
Karel Pičman 2025-04-23 10:46:20 +02:00
parent 4499dda2cc
commit 9f4d940dd1
2 changed files with 2 additions and 6 deletions

View File

@ -74,9 +74,7 @@ class Dmsf144 < ActiveRecord::Migration[4.2]
t.rename :dmsf_file_id, :entity_id
# TODO: The column cannot be removed on SQL server due to NOT NULL constraint.
# The constraint's name is random and therefore cannot be easily removed.
if ActiveRecord::Base.connection.adapter_name.downcase != 'sqlserver'
t.remove :locked
end
t.remove :locked if ActiveRecord::Base.connection.adapter_name.downcase != 'sqlserver'
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)

View File

@ -68,9 +68,7 @@ class DmsfFileContainerRollback < ActiveRecord::Migration[4.2]
t.remove_index %i[container_id container_type]
# TODO: The column cannot be removed on SQL server due to NOT NULL constraint.
# The constraint's name is random and therefore cannot be easily removed.
if ActiveRecord::Base.connection.adapter_name.downcase != 'sqlserver'
t.remove :container_type
end
t.remove :container_type if ActiveRecord::Base.connection.adapter_name.downcase != 'sqlserver'
t.rename :container_id, :project_id
t.index :project_id
end