We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description
It appears that we cannot create a table without a Id column. Even if created the Id column has to be a autoincrement type.
Id
To Reproduce
cargo loco generate model post name:string! url:string! icon:string!
cargo run task seed_data refresh:true
Error: DB(Exec(SqlxError(Database(PgDatabaseError { severity: Error, code: "42703", message: "column \"id\" does not exist", detail: None, hint: None, position: Some(Original(70)), where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: Some("parse_relation.c"), line: Some(3656), routine: Some("errorMissingColumn") }))))
In the db logs, we see:
2024-11-28 19:38:29.131 UTC [375] STATEMENT: SELECT setval(pg_get_serial_sequence('post', 'id'), COALESCE(MAX(id), 0) + 1, false) FROM post
Expected Behavior
Should run without any issues
Environment:
MacOSX
Additional Context
The issue is likely coming from this piece of logic here:
loco/src/db.rs
Lines 282 to 319 in e1b0392
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Description
It appears that we cannot create a table without a
Id
column. Even if created theId
column has to be a autoincrement type.To Reproduce
cargo run task seed_data refresh:true
In the db logs, we see:
Expected Behavior
Should run without any issues
Environment:
MacOSX
Additional Context
The issue is likely coming from this piece of logic here:
loco/src/db.rs
Lines 282 to 319 in e1b0392
Should this logic change?
The text was updated successfully, but these errors were encountered: