Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF4 CTP5 - HasColumnType not working

I want to override the default nvarchar(4000) for one of my string columns to a text data type in SQL Express. I use this code.

modelBuilder.Entity<Accommodation>()
               .Property(p => p.Information)
               .HasColumnType("text");

But the column type remains as nvarchar?

I also asked here http://social.msdn.microsoft.com/Forums/en/adonetefx/thread/a1d84ea9-2f8e-42f0-bb83-ac9f68805d6d?prof=required

like image 299
Daveo Avatar asked Dec 06 '25 13:12

Daveo


1 Answers

Ahh I just figured it out, adding the fluent mapping was not sufficient to force the table to dropAndCreate itself again even though I had DropCreateDatabaseIfModelChanges set.

I had to force it to update the table manually.

like image 163
Daveo Avatar answered Dec 09 '25 02:12

Daveo