Right now I am in development and use the code below to seed the lookup tables. But once it is in production and I want to add additional data how do I do that ? Do I use some sort of AddOrUpdate (not in core) in the seeding method ? Write a SQL script ?
private static async Task SeedRfReportStateTypesAsync(PwdrsContext pwdrsContext)
{
if (pwdrsContext.RfReportStateTypes.Any())
{
return;
}
List<RfReportStateType> rfReportStateTypes = new List<RfReportStateType>()
{
new RfReportStateType() { Name = "Draft", UpdatedBy = "SYSTEM", UpdatedOn = DateTime.Now}, //4
new RfReportStateType() { Name = "Review", UpdatedBy = "SYSTEM", UpdatedOn = DateTime.Now}, //3
new RfReportStateType() { Name = "Stage", UpdatedBy = "SYSTEM", UpdatedOn = DateTime.Now}, //2
new RfReportStateType() { Name = "Prod", UpdatedBy = "SYSTEM", UpdatedOn = DateTime.Now} //1
};
pwdrsContext.RfReportStateTypes.AddRange(rfReportStateTypes);
await pwdrsContext.SaveChangesAsync();
}