From 9f4d940dd162f094c5b039a12a6583796f27aecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Wed, 23 Apr 2025 10:46:20 +0200 Subject: [PATCH] SQL server compatibility --- db/migrate/07_dmsf_1_4_4.rb | 4 +--- db/migrate/20170421101901_dmsf_file_container_rollback.rb | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/db/migrate/07_dmsf_1_4_4.rb b/db/migrate/07_dmsf_1_4_4.rb index 5f24124c..36c80a0c 100644 --- a/db/migrate/07_dmsf_1_4_4.rb +++ b/db/migrate/07_dmsf_1_4_4.rb @@ -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) diff --git a/db/migrate/20170421101901_dmsf_file_container_rollback.rb b/db/migrate/20170421101901_dmsf_file_container_rollback.rb index 5db41935..c27e9776 100644 --- a/db/migrate/20170421101901_dmsf_file_container_rollback.rb +++ b/db/migrate/20170421101901_dmsf_file_container_rollback.rb @@ -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