-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
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
i64 in sqlite: bigint NOT NULL PRIMARY KEY AUTOINCREMENT #1832
Comments
It appears to be a quirkiness of SQLite I would suggest a workaround for now: #[sea_orm(primary_key)]
#[cfg_attr(feature = "sqlite", sea_orm(column_type = "Integer"))]
pub id: i64, |
Created an issue in sea-query, as there is nothing to be done on sea-orm side. |
fgaz
added a commit
to fgaz/attic
that referenced
this issue
Nov 6, 2023
Fixes the following error > AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY by applying the workaround from SeaQL/sea-orm#1832
fgaz
added a commit
to fgaz/attic
that referenced
this issue
Nov 6, 2023
Fixes the following error > AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY by applying the workaround from SeaQL/sea-orm#1832
fgaz
added a commit
to fgaz/attic
that referenced
this issue
Nov 6, 2023
Fixes the following error > AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY by applying the workaround from SeaQL/sea-orm#1832
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I am define
entity
, this is code:Migration
code:Steps to Reproduce
Expected Behavior
It is success, when i use postgresql.
But use sqlite, i am get error. why?
I am read this doc https://www.sea-ql.org/SeaORM/docs/generate-entity/entity-structure/
I think the create table sql is error。
In the doc, the
i64 id
should be"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT
but not"id" bigint NOT NULL PRIMARY KEY AUTOINCREMENT
Actual Behavior
Different the document description
in sqlite,
i64 ->
bigint
, ❌,different doci64 ->
integet
, expected,and same doc. but actual behavior isbigint
Reproduces How Often
always reproducible!
Versions
Cargo.toml
The text was updated successfully, but these errors were encountered: