diff --git a/JournalApp/Data/AppDbSeeder.cs b/JournalApp/Data/AppDbSeeder.cs index b5aef97..6d00a8b 100644 --- a/JournalApp/Data/AppDbSeeder.cs +++ b/JournalApp/Data/AppDbSeeder.cs @@ -55,13 +55,18 @@ void AddOrUpdate( category.Group = group; category.ReadOnly = readOnly; + // Only set these properties if the category is new. + if (!doesExist) + { + category.Enabled = enabled; + } + // Overwrite some flexible properties if it doesn't already exist OR is readonly and isn't allowed to change. if (!doesExist || readOnly) { category.Type = type; category.Name = name; category.Details = details; - category.Enabled = enabled; category.MedicationDose = medDose; category.MedicationEveryDaySince = medEveryDaySince; category.MedicationUnit = medUnit;