Example in the EF6 migration file Up
method.
I wish to add a new column B
in existing table Country
.
Sql("ALTER TABLE [dbo].[Country]
ADD [B] INT DEFAULT((0)) NOT NULL;")
Then I will need to add this new column B
to it's VCountry
view and I did the following:
DropView("VCountry")
Sql("CREATE VIEW [dbo].[VCountry]
AS
SELECT A, B FROM Country")
Everything looks good until I run the Add-Migration XXX
command and the Invalid column name 'B'.
prompt out.
What I trying to figure out is how to add the new column to the table and it's relevant view at the same migration file?
Any help would be much appreciated!