ORA-22859: invalid modification of columns

ORA-22859: invalid modification of columns

Postby infinity7117 » Tue 21 Oct 2014 11:25

Hello,

when using code first migrations,

public class Model
{
public int Id { get; set; }
public string Serial { get; set; }
}

creates a coresponding table with the 'Serial' field as a NCLOB oracle type.

but when adding length restraints to the model like this

public class Model
{
public int Id { get; set; }
[StringLength(50)]
public string Serial { get; set; }
}

and adding a new migration, the type must be converted to a nvarchar type, and Update-Database command fails with
ORA-22859: invalid modification of columns

is there a workaround for this or is manual editing the only option?

Thank you
infinity7117
 
Posts: 2
Joined: Tue 21 Oct 2014 11:19

Re: ORA-22859: invalid modification of columns

Postby Shalex » Thu 23 Oct 2014 14:48

Please refer to http://blog.devart.com/entity-framework-code-first-migrations-support-for-oracle-mysql-postgresql-and-sqlite.html#OperationSupport: the AlterColumn operation cannot be executed for a LOB column (CLOB/NCLOB/BLOB) in Oracle.

As a workaround, please use DropColumn / AddColumn instead of AlterColumn in this particular case.
Shalex
Devart Team
 
Posts: 7460
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle