MSSQL Default Constraints Nuisances

Description

Given a migration that adds a column with a default value on up() and drops it on down():

The down() migration will fail: Detail: [Macromedia][SQLServer JDBC Driver][SQLServer]The object 'df_users_someFlag' is dependent on column 'someFlag'.

As a regular user of schemabuilder, we just know to build-in dropConstraint() calls whenever we want to drop a column, but I wonder whether it would be appropriate to add something to the MSSQL grammar that tries to DROP IF EXISTS a constraint with the value df_<table>_<column>, since that's the name the constraint will get when SchemaBuilder first creates it.

Alternatively, and perhaps more simply, we could just add to the MSSQL docs so that people know they have an extra step to drop a column with a default value.

Fixed

Assignee

Unassigned

Reporter

Samuel W. Knowlton

Labels

None

Priority

Major
Configure