qb
qb copied to clipboard
Modify column with a constraint on SQLS errors
The following code gives the following error. It used to be a tinyint with a default constraint.
schema.alter( "mars_in_wash_sales", function( table ) {
table.modifyColumn( "shares", table.smallinteger( "shares").default(-999) );
} );
ERROR (5.2.1-alpha+00282)
Incorrect syntax near the keyword 'CONSTRAINT'.
C:\Users\johnw.CommandBox\cfml\modules\commandbox-migrations\modules\cfmigrations\modules\qb\models\Schema\SchemaBuilder.cfc ALTER TABLE [mars_in_wash_sales] ALTER COLUMN [shares] SMALLINT NOT NULL CONSTRAINT [df_mars_in_wash_sales_shares] DEFAULT -999