BUG: Column type does not update

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

BUG: Column type does not update

Post by RobertK » Thu 29 Nov 2018 11:47

1. Create a entity table, add a column with type GUID and save it! Close Entity Developer and reopen Entity Developer again.
2. Create another entity table, copy and paste the GUID column in step 1
3. Change the column type to "String"
4. add migration via command >> Add-Migration v1 -context "ApplicationDbContext" -OutputDir "Data"


Error: he property 'Example.Column1' is of type 'string' which is not supported by current database provider. Either change the property CLR type or ignore the property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: BUG: Column type does not update

Post by Shalex » Wed 05 Dec 2018 18:11

With Entity Developer and dotConnect for PostgreSQL, the output is:

Code: Select all

PM> Add-Migration v1 -context "ApplicationDbContext" -OutputDir "Data"
To undo this action, use Remove-Migration.
PM>

...

   public partial class v1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Class1s",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Class1s", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Class2s",
                columns: table => new
                {
                    Id = table.Column<string>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Class2s", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Class1s");

            migrationBuilder.DropTable(
                name: "Class2s");
        }
    }
Please send us a small test project so that we can reproduce the issue.

Post Reply