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

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
dresel
Posts: 18
Joined: Tue 20 Nov 2012 13:38

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

Post by 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.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

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

Post by 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

Post by 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/postgr ... nload.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.

Post Reply