Skip to content

Auto-increment not working with SQLite #504

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

Closed
andrewmunro opened this issue Mar 5, 2021 · 3 comments
Closed

Auto-increment not working with SQLite #504

andrewmunro opened this issue Mar 5, 2021 · 3 comments

Comments

@andrewmunro
Copy link

Found a similar issue to #209, however the fix in dc3dc09 doesn't work for me as my data types are lowercase 😑.

Sadly I can't change the types easily as I'm relying on a mysql2sqlite conversion script.

Here's an example table, where id does not have the autoIncrement attribute set:

CREATE TABLE `account` (
  `id` integer  NOT NULL PRIMARY KEY AUTOINCREMENT
,  `username` varchar(32) NOT NULL DEFAULT ''     
,  `gmlevel` integer  NOT NULL DEFAULT '0'        
,  `sessionkey` longtext
,  `v` longtext
,  `s` longtext
,  `email` text
,  `joindate` timestamp NOT NULL DEFAULT current_timestamp
,  `lockedIp` varchar(30) NOT NULL DEFAULT '0.0.0.0'
,  `failed_logins` integer  NOT NULL DEFAULT '0'
,  `locked` integer  NOT NULL DEFAULT '0'
,  `active_realm_id` integer  NOT NULL DEFAULT '0'
,  `expansion` integer  NOT NULL DEFAULT '0'
,  `mutetime` integer  NOT NULL DEFAULT '0'
,  `locale` varchar(4) NOT NULL DEFAULT ''
,  `token` text
,  UNIQUE (`username`)
);

Could we add a simple toUpperCase() on record.type or something?

@steveschmitt
Copy link
Collaborator

Sorry, I thought the types were returned uppercase from sqlite. Will be fixed in next release.

@steveschmitt
Copy link
Collaborator

Fixed in 0.8.1

@andrewmunro
Copy link
Author

🎉 Thanks!

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

No branches or pull requests

2 participants