activerecord-sqlserver-adapter
activerecord-sqlserver-adapter copied to clipboard
change_column_default cannot drop default constraint
Issue
change_column_default and similar methods not working as intended
Expected behavior
according to the documentation change_column_default(:users, :email, nil)
change_column_default("SomeTable", "SomeColumn", nil)
should drop the default constraint on SomeColumn.
Actual behavior
ALTER TABLE [SomeTable] ADD CONSTRAINT DF_SomeTable_SomeColumn DEFAULT NULL FOR [SomeColumn]
gets executed which results in a (Null)
default constraint.
How to reproduce
use
change_column_default("SomeTable", "SomeColumn", nil)
Details
-
Rails version:
7.0.1
-
SQL Server adapter version:
7.0.0.0
-
TinyTDS version:
2.1.5