title: How can I remove a Column that has a Constraint with a migration from the DB (ASP.NET MVC5)
body: <p>Each time I try dropping a column with the following migration:</p>
  
  <pre><code>public partial class RemoveProject_Id1InAspNetUsers2 : DbMigration
      {
          public override void Up()
          {
              DropColumn("dbo.AspNetUsers", "Project_Id1");
          }
  
          public override void Down()
          {
          }
      }
  </code></pre>
  
  <p>I get the following error after I <code>Update-Database</code> in PMC:</p>
  
  <pre><code>The index 'IX_Project_Id1' is dependent on column 'Project_Id1'.
  The object 'FK_dbo.AspNetUsers_dbo.Projects_Project_Id1' is dependent on column 'Project_Id1'.
  ALTER TABLE DROP COLUMN Project_Id1 failed because one or more objects access this column.
  </code></pre>
  
  <p>This is my AspNetUser Table:
  <a href="https://i.stack.imgur.com/xGeDS.png" rel="nofollow noreferrer">dbo.AspNetUser DB Image</a></p>
  
  <p>This is my Project Class:</p>
  
  <pre><code>public class Project
  {
      public int Id { get; set; }
  
      [DisplayName("Project Manager")]
      public string ProjectManagerId { get; set; }
  
      //        [ForeignKey("ProjectManagerId")]
      //        public ApplicationUser ProjectManager { get; set; }
  
      //public string ProjectMembersId { get; set; }
  
      //public List&lt;ApplicationUser&gt; ProjectMembers { get; set; }
  
      public virtual ICollection&lt;ProjectResource&gt; OurProjectResources { get; set; }
  
  }
  </code></pre>
  
  <p>I have tried removing removing all references of ApplicationUser from my Project Class. </p>
  
  <p>PS: I've tried running a Migration of this SQL statement: 
  <code>Sql("ALTER TABLE AspNetUsers DROP CONSTRAINT FK_AspNetUsers_Projects_Project_Id1");</code> and it gives an error that : </p>
  
  <pre><code>'FK_AspNetUsers_Projects_Project_Id1' is not a constraint.
  Could not drop constraint. See previous errors.
  </code></pre>
  
  <p>I'm using EF6 Code First Workflow.</p>
  
  <p><a href="https://social.msdn.microsoft.com/Forums/sqlserver/en-US/6bb05268-946a-4607-8793-dfd60c468974/drop-column-not-working-one-or-more-objects-access-this-column?forum=sqlexpress" rel="nofollow noreferrer">This post</a> explains what the problem is, but I will like to understand how to write the migration to remove the column from the DB.</p>