Add licenses to database.

This commit is contained in:
2019-05-27 17:42:57 +01:00
parent 662e5de164
commit 82956c6b77
7 changed files with 13579 additions and 1 deletions

View File

@@ -67,6 +67,7 @@ namespace Cicm.Database.Models
public virtual DbSet<SoundByMachine> SoundByMachine { get; set; }
public virtual DbSet<SoundSynth> SoundSynths { get; set; }
public virtual DbSet<StorageByMachine> StorageByMachine { get; set; }
public virtual DbSet<License> Licenses { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
@@ -1026,6 +1027,16 @@ namespace Cicm.Database.Models
entity.HasOne(d => d.Machine).WithMany(p => p.Storage).HasForeignKey(d => d.MachineId)
.HasConstraintName("fk_storage_by_machine_machine");
});
modelBuilder.Entity<License>(entity =>
{
entity.HasIndex(e => e.Name);
entity.HasIndex(e => e.SPDX);
entity.HasIndex(e => e.FsfApproved);
entity.HasIndex(e => e.OsiApproved);
});
Seeders.License.Seed(modelBuilder);
}
}
}