Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

in my application i use code first.When its create a database at first time, its create the UserNameIndex against the User table (I'm using Identity here). If i want delete that index, i just add-migration and on the Down method i add the following code.

public override void Down()
{
DropIndex("dbo.Users", new[] { "UserNameIndex" });
}

After i update-database, its doesn't update the user table anymore, please help me to solve it.

Thanks

What I have tried:

1. Add-migration InitialCreate, its create following class

public partial class InitialCreate : DbMigration
{
public override void Up()
{
}

public override void Down()
{
DropIndex("dbo.Users", new[] { "UserNameIndex" });
}
}

2. Update-database
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900