Page 1 of 1

ORA-22859: invalid modification of columns

Posted: Tue 21 Oct 2014 11:25
by infinity7117
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

Re: ORA-22859: invalid modification of columns

Posted: Thu 23 Oct 2014 14:48
by Shalex
Please refer to http://blog.devart.com/entity-framework ... ionSupport: 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.