Skip to content

Error when creating references #76

@randallmeeker

Description

@randallmeeker

MySQL 5.5

<cfcomponent extends="plugins.dbmigrate.Migration" hint="creates groups table">
  <cffunction name="up">
    <cfscript>
      t = createTable(name='groups');
      t.string(columnNames='displayName', null=false, limit='100');
      t.string(columnNames='nameSpace', null=false, limit='100');
      t.string(columnNames='description', limit='255');
      t.references('user');
      t.timestamps();
      t.create();
    </cfscript>
  </cffunction>
  <cffunction name="down">
    <cfscript>
      dropTable('groups');
    </cfscript>
  </cffunction>
</cfcomponent>

results in the following sql
CREATE TABLE groups (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
displayName VARCHAR(100) NOT NULL,
nameSpace VARCHAR(100) NOT NULL,
description VARCHAR(255),
userid INT NOT NULL,
createdat DATETIME,
updatedat DATETIME,
deletedat DATETIME,

);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions