Closed shivanandbhangari closed 7 years ago
Hey @shivanandbhangari.
After creating the db and writing the code for models and the migrations, make sure you run
sequelize db:migrate
to actually create the necessary tables in the db. Let me know if that fixes that issue.
@waiyaki Yes it works thanks a lot Waiyaki. Super exapmle, learnt lot from this code. Thank you once again.
Great, thank you!
Hey @shivanandbhangari.
After creating the db and writing the code for models and the migrations, make sure you run
sequelize db:migrate
to actually create the necessary tables in the db. Let me know if that fixes that issue.
Thanks!
Nice tutorial sir, but i am getting Dequelize DatabaseError while trying to request localhost:8000/api/todos in postman. The below is the output
{ "name": "SequelizeDatabaseError", "parent": { "name": "error", "length": 115, "severity": "ERROR", "code": "42P01", "position": "13", "file": "src\backend\parser\parse_relation.c", "line": "984", "routine": "parserOpenTable", "sql": "INSERT INTO \"Todos\" (\"id\",\"title\",\"createdAt\",\"updatedAt\") VALUES (DEFAULT,'first-todo','2017-06-15 06:11:49.889 +00:00','2017-06-15 06:11:49.889 +00:00') RETURNING ;" }, "original": { "name": "error", "length": 115, "severity": "ERROR", "code": "42P01", "position": "13", "file": "src\backend\parser\parse_relation.c", "line": "984", "routine": "parserOpenTable", "sql": "INSERT INTO \"Todos\" (\"id\",\"title\",\"createdAt\",\"updatedAt\") VALUES (DEFAULT,'first-todo','2017-06-15 06:11:49.889 +00:00','2017-06-15 06:11:49.889 +00:00') RETURNING ;" }, "sql": "INSERT INTO \"Todos\" (\"id\",\"title\",\"createdAt\",\"updatedAt\") VALUES (DEFAULT,'first-todo','2017-06-15 06:11:49.889 +00:00','2017-06-15 06:11:49.889 +00:00') RETURNING *;" }
Can you please help me out to resolve this error. Thank you