Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when execute sql #40

Open
gronel opened this issue Nov 22, 2019 · 0 comments
Open

Error when execute sql #40

gronel opened this issue Nov 22, 2019 · 0 comments

Comments

@gronel
Copy link

gronel commented Nov 22, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant