Skip to content

Its impossible to alter a table to add table.timestamps() #310

Description

@rodriciru
schema.alter( "Html", function( table ){
			table.addColumn( table.timestamps() );
		} );

->

Recieved a TableIndex instead of a Column when trying to create a Column.

Did you maybe try to add a column and a constraint in an ALTER clause at the same time? Split those up in to separate addColumn and addConstraint commands.
\modules\commandbox-migrations\modules\cfmigrations\modules\qb\models\Grammars\BaseGrammar.cfc: line 1321
1319:                 type = "InvalidColumn",
1320:                 message = "Recieved a TableIndex instead of a Column when trying to create a Column.",
1321:                 detail = "Did you maybe try to add a column and a constraint in an ALTER clause at the same time? Split those up in to separate addColumn and addConstraint commands."
1322:             );
1323:         }
schema.alter( "Html", function( table ){
			table.addConstraint( table.timestamps() );
		} );

->


Invalid call of the function [addConstraint], first Argument [constraint] is of invalid type, Cannot cast Object type [Component qb.models.Schema.Blueprint] to a value of type [TableIndex]

the function is located at [C:\Users\Rodrigo\.CommandBox\cfml\modules\commandbox-migrations\modules\cfmigrations\modules\qb\models\Schema\Blueprint.cfc]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions