-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: Make AUTOINCREMENT more first-class #10228
Comments
Assigning to @AndriySvyryd to give SQLite the same treatment (flag conventions, etc.) that SQL Server uses for this. @bricelam can help out on the Migrations part, if needed. |
@AndriySvyryd I added "propose-close" to make you feel at home with this one. |
It utilizes SqlServerValueGenerationStrategy. |
Turns out SqlServer:Identity is also not first class. It is computed based on ValueGenerationStrategy and ValueGenerated flag. Aligned Sqlite to do the same to compute AutoIncrement only when applicable Resolves #10228
Also not in v 8? =) |
@voroninp as always, we prioritize features based on user interest (among other things), and this issue has received only 2 votes. |
@roji , I keep questioning myself how come I always bump into edge cases while others are happy with what they have =D |
To be fair, at least four other people have ran into issues because of the current design. Unfortunately they, like @voroninp, haven't upvoted this issue. Remember to vote if you want to see things fixed. With 1.9k issues it really can make years of difference. |
@bricelam, I'd 100% upvote, if I faced the issue before, but it happened on the 2nd day after I used sqlite provider for the first time. =) |
4th Anniversary coming in two weeks or so and I just stumbled upon this while using SQLite for in-memory db for unit testing sheesh. Upvoted, maybe one day. |
+1 This one is important. The current implementation is causing a lot of issues with value converters. |
+1, |
+1 |
Generates following migration
This is because of ad-hoc logic here
https://github.com/aspnet/EntityFrameworkCore/blob/b86eb8548a0deedc1199c3b4bc6b8632bd7824e3/src/EFCore.Sqlite.Core/Migrations/Internal/SqliteMigrationsAnnotationProvider.cs#L34-L38
And due to other hacks, later all annotations which are not on PK gets ignored. We should make autoincrement a first class for provider just like how SqlServer deals with identity.
@ErikEJ - SqlCE faces the same issue due to similar code and in SQL CE it tries to create multiple Identity columns failing at
Update-Database
command. You would also need to update SQL CE provider. (I found this after talking to customer on slack who hit issue on SQL CE)The text was updated successfully, but these errors were encountered: