Add database changes for allowing multiple resources

This commit is contained in:
jvyden 2021-10-20 18:09:34 -04:00
parent 685f57fd28
commit e63a4b812a
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
8 changed files with 442 additions and 13 deletions

View file

@ -22,6 +22,14 @@ namespace ProjectLighthouse {
MySqlServerVersion.LatestSupportedServerVersion
);
protected override void OnModelCreating(ModelBuilder modelBuilder) {
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Slot>()
.Property<string>(nameof(Slot.ResourceCollection))
.HasField(nameof(Slot.ResourceCollection));
}
public async Task<User> CreateUser(string username) {
User user;
if((user = await Users.Where(u => u.Username == username).FirstOrDefaultAsync()) != null)