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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Cicm.Database.Models
{
public class License : BaseModel<int>
{
[Required]
public string Name { get; set; }
[DisplayName("SPDX identifier")]
public string SPDX { get; set; }
[DisplayName("FSF approved")]
[Required]
public bool FsfApproved { get; set; }
[DisplayName("OSI approved")]
[Required]
public bool OsiApproved { get; set; }
[DisplayName("License text link")]
[StringLength(512)]
public string Link { get; set; }
[DisplayName("License text")]
[Column(TypeName = "longtext")]
[StringLength(131072)]
public string Text { get; set; }
}
}

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);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Version>3.0.99.585</Version>
<Version>3.0.99.591</Version>
<Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product>