Revize b8028d82
Přidáno uživatelem Vojtěch Bartička před asi 3 roky(ů)
Backend/Core/Seeding/Seeder.cs | ||
---|---|---|
14 | 14 |
{ |
15 | 15 |
public static void SeedDevelopment(DatabaseContext context) |
16 | 16 |
{ |
17 |
if (!context.Documents.Any())
|
|
17 |
if (!context.Users.Any(u => u.Role == ERole.ADMINISTRATOR))
|
|
18 | 18 |
{ |
19 | 19 |
DocumentContent content = new DocumentContent() { Content = "Dummy content" }; |
20 | 20 |
context.DocumentContents.Add(content); |
... | ... | |
60 | 60 |
|
61 | 61 |
public static void SeedProduction(DatabaseContext context) |
62 | 62 |
{ |
63 |
if (!context.Documents.Any())
|
|
63 |
if (!context.Users.Any(u => u.Role == ERole.ADMINISTRATOR))
|
|
64 | 64 |
{ |
65 | 65 |
User admin = new User() { Name = "Admin", Surname = "Admin", Role = ERole.ADMINISTRATOR, Username = "admin", Password = "123a456b789c" }; |
66 | 66 |
context.Users.Add(admin); |
Také k dispozici: Unified diff
Fixed seeding