npgsql/EntityFramework6.Npgsql

Problem maping Datetime after switch database provider

DancingOnWater opened this issue · 0 comments

Start point:
1.Postgresql v 9.6
2. MsSQL 2008
3. .Net 4.7
4. EntityFramework6.Npgsql v 6.4.1

Datamodel like this:

public class ExploreModel:DbContext{
       public ExploreModel() : base("Explore"){}
       public DbSet<Rbi> RBI { get; set; }
 }
 public class Rbi{
       public int Id { get; set; }
       public DateTime Time { get; set; }
   }

If i add migration in one database i get migration like this:

public override void Up()
        {
            CreateTable(
                "dbo.Rbis",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Time = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
         }

Seems good, but after i switch on another and update database, entityframework throw exception: "there are some changes in model". if i try add new migration, i see such thing:
AlterColumn("dbo.Rbis", "Time", c => c.DateTime(nullable: false));
In another word: he let me migrate from datetime to datetime.

P.S. There is a compilable small project for problem demonstration in addition
NPGSQLError.zip
.