mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add licenses to database.
This commit is contained in:
5399
Cicm.Database/Migrations/20190527160705_Licenses.Designer.cs
generated
Normal file
5399
Cicm.Database/Migrations/20190527160705_Licenses.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1668
Cicm.Database/Migrations/20190527160705_Licenses.cs
Normal file
1668
Cicm.Database/Migrations/20190527160705_Licenses.cs
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
27
Cicm.Database/Models/License.cs
Normal file
27
Cicm.Database/Models/License.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,6 +67,7 @@ namespace Cicm.Database.Models
|
|||||||
public virtual DbSet<SoundByMachine> SoundByMachine { get; set; }
|
public virtual DbSet<SoundByMachine> SoundByMachine { get; set; }
|
||||||
public virtual DbSet<SoundSynth> SoundSynths { get; set; }
|
public virtual DbSet<SoundSynth> SoundSynths { get; set; }
|
||||||
public virtual DbSet<StorageByMachine> StorageByMachine { get; set; }
|
public virtual DbSet<StorageByMachine> StorageByMachine { get; set; }
|
||||||
|
public virtual DbSet<License> Licenses { get; set; }
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
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)
|
entity.HasOne(d => d.Machine).WithMany(p => p.Storage).HasForeignKey(d => d.MachineId)
|
||||||
.HasConstraintName("fk_storage_by_machine_machine");
|
.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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
3196
Cicm.Database/Seeders/License.cs
Normal file
3196
Cicm.Database/Seeders/License.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||||
<Version>3.0.99.585</Version>
|
<Version>3.0.99.591</Version>
|
||||||
<Company>Canary Islands Computer Museum</Company>
|
<Company>Canary Islands Computer Museum</Company>
|
||||||
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
||||||
<Product>Canary Islands Computer Museum Website</Product>
|
<Product>Canary Islands Computer Museum Website</Product>
|
||||||
|
|||||||
Reference in New Issue
Block a user