Sqlite Identity column is required to be int32
See original GitHub issueDescribe the bug
Sqlite code generator seems to require that Identity column must be Int32 - in which case it will be defined as autoincrement. I can’t find any reason for this in the documentation. In fact, the sqlite doc says that primary autoincrement key will be mapped to the hidden ROWID column, which is 64 bit. So there is no reason that the code generator shouldn’t accept Int64 at least. The relevant code line:
Sqlite doc:
https://sqlite.org/autoinc.html
To Reproduce In a migration define a column like this:
this.Create.Table("TestTable")
.WithColumn("Id").AsInt64().PrimaryKey().Identity()
And run a migration for Sqlite
Expected behavior
New table successfully generated.
Information (please complete the following information):
- OS: Ubuntu 20.04
- Platform .net5
- FluentMigrator version latest
- FluentMigrator runner [ FluentMigrator.Console ]
- Database Management System [ SQLite ]
- Database Management System Version [ N/A ]
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
SQLite Autoincrement
1. Summary · The AUTOINCREMENT keyword imposes extra CPU, memory, disk space, and disk I/O overhead and should be avoided if not strictly...
Read more >Understanding the SQLite AUTOINCREMENT
The main purpose of using attribute AUTOINCREMENT is to prevent SQLite to reuse a value that has not been used or a value...
Read more >How to create Autoincrement column in SQLite using EF ...
NET Standard app. My model has an entity of type Primary Key integer which should be served as auto increment according to SQLite...
Read more >SQLite - AUTOINCREMENT
SQLite AUTOINCREMENT is a keyword used for auto incrementing a value of a field in the table. We can auto increment a field...
Read more >Is it good practice to always have an autoincrement integer ...
I usually use an "identity" column (auto-incremennting integer) when defining new tables for "long-lived" data (records I expect to insert once ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll be happy to create a PR to address this problem.
It’s not too urgent for me, so feel free to overhaul…