-
Notifications
You must be signed in to change notification settings - Fork 690
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
SQLite table ignoring primaryKey override #1258
Comments
I found the issue while looking in Column.kt and I am opening a pull request to fix this issue, let me know if I missed something and/or if I need to improve anything. Also feel free to just reject the pull request. |
Hi @lcsphantom , thank you for a report and PR. I'll push a fix and close your PR. |
Issue:
While using SQLite3 dialect and trying to create a table with autoincrement() and overriding primaryKey, the generated Table does not increment or insert the primary key value.
Computer:
Linux Mint 20.1
IntelliJ 2021.1.1 (Ultimate Edition) April 30, 2021
How to replicate:
Gradle
Connection
Table
Generated SQL
CREATE TABLE IF NOT EXISTS "User" (id INT, "name" VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL, username VARCHAR(100) NOT NULL, CONSTRAINT PK_USER_ID PRIMARY KEY (id))
Fix but not ideal (deprecrated method primaryKey()):
Table
Generated SQL
CREATE TABLE IF NOT EXISTS "User" (id INTEGER PRIMARY KEY AUTOINCREMENT, "name" VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL, username VARCHAR(100) NOT NULL)
Related issue (to some extent / outdated code)
#669
The text was updated successfully, but these errors were encountered: