Code-First Migrations: AlterColumn throws exception when changing identity to true

Code-First Migrations: AlterColumn throws exception when changing identity to true

Postby dresel » Thu 04 Dec 2014 09:26

Hi,

when changing an entity key from DatabaseGeneratedOption.None to DatabaseGeneratedOption.Identity the following migration code block will throw an exception:

Code: Select all
DropPrimaryKey("dbo.TestTables");
AlterColumn("dbo.TestTables", "TestTableID", c => c.Int(nullable: false, identity: true));
AddPrimaryKey("dbo.TestTables", "TestTableID");


The exception says "serial does not exist". I also sent you an sample project to reproduce this issue.
dresel
 
Posts: 18
Joined: Tue 20 Nov 2012 13:38

Re: Code-First Migrations: AlterColumn throws exception when changing identity to true

Postby MariiaI » Thu 04 Dec 2014 12:12

Thank you for the report. We have reproduced this issue. We will investigate it and inform you about the results as soon as possible.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Code-First Migrations: AlterColumn throws exception when changing identity to true

Postby MariiaI » Fri 19 Dec 2014 05:49

The bug related to the "Type 'serial' doesn't exist" error while performing the ALTER TABLE statement via Code-First migrations is fixed.
New build of dotConnect for PostgreSQL 7.3.313 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/postgresql/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=3&t=30982.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Return to dotConnect for PostgreSQL