brockallen / BrockAllen.MembershipReboot

MembershipReboot is a user identity management and authentication library.
Other
742 stars 238 forks source link

Custom User Migrations after adding Column #619

Closed doublej42 closed 8 years ago

doublej42 commented 8 years ago

I'm using MembershipReboot with IdentityServer and I added a column

public class CustomUser : RelationalUserAccount
{
    [Display(Name="First Name")]
    public virtual string FirstName { get; set; }
    [Display(Name = "Last Name")]
    public virtual string LastName { get; set; }

    public bool AllowPasswordLogin { get; set; }

}

How do I get these changes to be reflected in the database?

(new to code first entity framework)

brockallen commented 8 years ago

I think I started a sample for that here: https://github.com/brockallen/BrockAllen.MembershipReboot/blob/master/samples/CustomUserAccount/CustomUserAccount/Program.cs

As for migrations, you might want to build your own migrations. When I started MR I tried to maintain migrations in the project, but then realized that was the wrong approach. Migrations should be the app's responsibility, not the library's.

doublej42 commented 8 years ago

I'm actually using route code from: https://github.com/IdentityServer/IdentityServer3.MembershipReboot/blob/41d0651924d153f56478384e75d98edb764a0e60/source/WebHost/MR/CustomUser.cs

I ended up modifying the database by hand.