qb icon indicating copy to clipboard operation
qb copied to clipboard

Modify column with a constraint on SQLS errors

Open Daemach opened this issue 3 years ago • 5 comments

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

Daemach avatar Mar 07 '21 21:03 Daemach