Giter Site home page Giter Site logo

Comments (5)

jzabroski avatar jzabroski commented on September 27, 2024

This does not sound like a FluentMigrator issue. It sounds like a coding issue where you are trying to cast in C# from long to double?. You mentioned Dapper twice, so I wonder if its really a Dapper issue. I'm not sure what code you wrote to achieve this exception, so I am closing this issue as not reproducible.

from fluentmigrator.

jzabroski avatar jzabroski commented on September 27, 2024

If you want to customize data types per database, one workaround would be to use the IfDatabase clause to customize logic per database tag.

from fluentmigrator.

ElDuderinoBerlin avatar ElDuderinoBerlin commented on September 27, 2024

I do this:

using var trans = await dest.BeginTransactionAsync(tks.Token);
await dest.DeleteAllAsync<Asset>(trans);

var copied = await dest.InsertAsync(await source.GetAllAsync<Asset>(), trans);
await trans.CommitAsync(tks.Token);

Then i get:

DataException: Error parsing column 49 (TrailingAnnualDividendRate=0 - Int64)
InvalidCastException: Unable to cast object of type 'System.Int64' to type 'System.Nullable`1[System.Double]'.

The datatype must be a double (REAL), but used is NUMERIC, which is INT64 & REAL (double) at the same time depending on the value stored in the table.

I do not cast. Dapper evaluates the value, which is INT64 but want write a double and doesn't cast.
I just just changed all NUMERICs to REAL and it works. It's indeed an issue of FluentMigrator, because it generates the DDL!

Regards
Martin

from fluentmigrator.

ElDuderinoBerlin avatar ElDuderinoBerlin commented on September 27, 2024

Just looked into https://github.com/fluentmigrator/fluentmigrator/blob/a292999ca5b4e3a462e5db0340d3cfee4883b9a0/src/FluentMigrator.Runner.SQLite/Generators/SQLite/SQLiteTypeMap.cs

Used is indeed a REAL, but why is standing there a NUMERIC?

Hm...

from fluentmigrator.

ElDuderinoBerlin avatar ElDuderinoBerlin commented on September 27, 2024

Found the issue! M$!
Microsoft.Data.Sqlite
Holy shit!

from fluentmigrator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.