-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Column): Explicitly name default constraint for MSSQL
* update MSSQL for DEFAULT constraint * Fix failing test for `last` * Update MSSQL tests and wrap default constriant name * Allow for a table level `default` for removing default constraints with generated names This method won't actually create a constraint, but it is used for removing constraints with auto-generated names. For instance, if you used the default name in ``` schema.create( "my_table", function( table ) { table.boolean( "trueOrFalse" ).default( 0 ); } ); ``` it may not be obvious that the constraint name is `df_my_table_trueOrFalse`. This method let's you stay oblivious to the auto-generated name when dropping the constraint. ``` schema.alter( "my_table", function( table ) { table.dropConstraint( table.default( "trueOrFalse" ) ); table.dropColumn( "trueOrFalse" ); } ); ```
- Loading branch information
Showing
6 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters