-
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
Decimal type should be NUMERIC in Sqlite #18756
Comments
/cc @bricelam |
NUMERIC is a type affinity. It means SQLite will prefer REAL (64-bit floating-point values) or INTEGER (64-bit integer values) as the on-disk format. In .NET, |
If you don't need the precision, but would still like to work with modelBuilder.Entity<MyEntity>().Property(e => e.MyDecimalProperty)
.HasConversion<double>()
.HasColumnType("NUMERIC"); |
I tried to do this in my db context:
So, as you can see, I want to set column type to numeric, only if DBMS is Sqlite and clr type is decimal. But this does not work. Created column type is still TEXT. |
@AdamJachocki I am not able to reproduce this. Please post a small, runnable project/solution or complete code listing that demonstrates the behavior you are seeing. |
EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it. BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions. |
Now, when one does a migration in Sqlite, all decimal types create TEXT data column in Sqlite database. I think they should create NUMERIC data type according to this (table in 3.1.1 section): https://www.sqlite.org/datatype3.html -> look at DECIMAL(10,5) data type. It should be represented as NUMERIC.
The text was updated successfully, but these errors were encountered: