0

I'm setting up a node app in server. This is working fine locally. But in server it gives error:

SequelizeBaseError: ER_CANT_CREATE_TABLE: Can't create table 'databaseName.tableName' (errno: 150)

Database has all fields set up. If same database is imported locally, that is working fine. The server database user has all rights to create table.

Can anyone help?

Sovon
  • 1,804
  • 1
  • 22
  • 30

2 Answers2

0

Can you show your table or just check if all the foreign key values and tables are defined before this and all the signed and unsigned values are taken care of.

PSYDUCK
  • 116
  • 1
  • 10
  • Yes, all checked and are fine. I've imported the server database locally and it's working fine. – Sovon Jan 23 '17 at 11:15
0

Solved it. It was table name capital small letter issue. Table names were not explicitly defined in the model, that's why it was creating like object name with capital first letter (like Message).

Defined the table names explicitly: tableName: 'messages' and it's working.

Sovon
  • 1,804
  • 1
  • 22
  • 30