Skip to content

Error when execute sql  #40

@gronel

Description

@gronel

Hi,
I created migration via sql script for my ups i have this
CREATE TABLE messages(IDint(11) NOT NULL AUTO_INCREMENT,userIDFromint(11) NOT NULL,userIDToint(11) NOT NULL,contenttext NOT NULL,roomIdint(11) NOT NULL DEFAULT '0',created_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE rooms (
roomId int(11) NOT NULL AUTO_INCREMENT,
roomName varchar(50) DEFAULT NULL,
creatorId int(11) DEFAULT NULL,
created_date timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (roomId)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;`

In my down sql i have this
drop table messages drop table rooms

then for my database connection
"prod": { "host": "localhost", "user": "maldito" , "password" : "balba2018!" , "database": "chatdb", "port":"3306", "driver": "mysql" },
when running this code i got an error
db-migrate up --config config/database.json -e prod

[ERROR] AssertionError [ERR_ASSERTION]: ifError got unwanted exception: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE rooms (
roomId int(11) NOT NULL AUTO_INCREMENT,

then I try to remove then last sql it run perfectly


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions