yug95 / node-mysql

Node with mysql boilerplate
MIT License
76 stars 47 forks source link

Issue with table user not found #3

Closed monikagupta78 closed 6 years ago

monikagupta78 commented 6 years ago

I have setup this sample. not sure if need to create db and table in mysql separately ? I am getting below error:

{ "code": "ER_NO_SUCH_TABLE", "errno": 1146, "sqlMessage": "Table 'sampledb.user' doesn't exist", "sqlState": "42S02", "index": 0, "sql": "SELECT * FROM user WHERE username ='test'" }

is there any db script that needs to be executed? DB i create manually, but not sure about table details.

curtisolson commented 6 years ago

/documents/sql-script/script_v1.sql has CREATE TABLE statement. The syntax was off for my version of MySQL, but that if you run that script in any query tool, you should be good to go.

yug95 commented 6 years ago

@monikagupta78 you can check all models which ever table used can create or else you can comment code for that particular route ex : user and can create your own table.

Any way thanks for updating i will change in readme.

yug95 commented 6 years ago

@curtisolson thanks for mentioning those point.