Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

SequelizeDatabaseError #1

Closed
shivanandbhangari opened this issue Jun 15, 2017 · 4 comments
Closed

SequelizeDatabaseError #1

shivanandbhangari opened this issue Jun 15, 2017 · 4 comments

Comments

@shivanandbhangari
Copy link

shivanandbhangari commented Jun 15, 2017

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

@waiyaki
Copy link
Owner

waiyaki commented Jun 18, 2017

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.

@shivanandbhangari
Copy link
Author

@waiyaki
Yes it works thanks a lot Waiyaki. Super exapmle, learnt lot from this code. Thank you once again.

@waiyaki
Copy link
Owner

waiyaki commented Jun 19, 2017

Great, thank you!

@waiyaki waiyaki closed this as completed Jun 19, 2017
@jerrychong25
Copy link

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!

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

No branches or pull requests

3 participants