mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 11:04:25 +00:00
Add software variant by compilation media.
This commit is contained in:
6840
Marechai.Database/Migrations/20200611230627_AddSoftwareByCompilationMedia.Designer.cs
generated
Normal file
6840
Marechai.Database/Migrations/20200611230627_AddSoftwareByCompilationMedia.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2020 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Marechai.Database.Migrations
|
||||
{
|
||||
public partial class AddSoftwareByCompilationMedia : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable("SoftwareVariantByCompilationMedia", table => new
|
||||
{
|
||||
Id = table.Column<ulong>(nullable: false).
|
||||
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
CreatedOn = table.Column<DateTime>(nullable: false).
|
||||
Annotation("MySql:ValueGenerationStrategy",
|
||||
MySqlValueGenerationStrategy.IdentityColumn),
|
||||
UpdatedOn = table.Column<DateTime>(nullable: false).
|
||||
Annotation("MySql:ValueGenerationStrategy",
|
||||
MySqlValueGenerationStrategy.ComputedColumn),
|
||||
Path = table.Column<string>(nullable: true), PathSeparator = table.Column<string>(nullable: false),
|
||||
SoftwareVariantId = table.Column<ulong>(nullable: false), MediaId = table.Column<ulong>(nullable: false)
|
||||
}, constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SoftwareVariantByCompilationMedia", x => x.Id);
|
||||
|
||||
table.ForeignKey("FK_SoftwareVariantByCompilationMedia_Media_MediaId", x => x.MediaId, "Media", "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
table.ForeignKey("FK_SoftwareVariantByCompilationMedia_SoftwareVariants_SoftwareV~",
|
||||
x => x.SoftwareVariantId, "SoftwareVariants", "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex("IX_SoftwareVariantByCompilationMedia_MediaId",
|
||||
"SoftwareVariantByCompilationMedia", "MediaId");
|
||||
|
||||
migrationBuilder.CreateIndex("IX_SoftwareVariantByCompilationMedia_Path",
|
||||
"SoftwareVariantByCompilationMedia", "Path");
|
||||
|
||||
migrationBuilder.CreateIndex("IX_SoftwareVariantByCompilationMedia_SoftwareVariantId",
|
||||
"SoftwareVariantByCompilationMedia", "SoftwareVariantId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder) =>
|
||||
migrationBuilder.DropTable("SoftwareVariantByCompilationMedia");
|
||||
}
|
||||
}
|
||||
@@ -3466,6 +3466,33 @@ namespace Marechai.Database.Migrations
|
||||
b.ToTable("SoftwareVariants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marechai.Database.Models.SoftwareVariantByCompilationMedia", b =>
|
||||
{
|
||||
b.Property<ulong>("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<DateTime>("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<ulong>("MediaId").HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<string>("Path").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
||||
|
||||
b.Property<string>("PathSeparator").IsRequired().HasColumnType("varchar(1) CHARACTER SET utf8mb4");
|
||||
|
||||
b.Property<ulong>("SoftwareVariantId").HasColumnType("bigint unsigned");
|
||||
|
||||
b.Property<DateTime>("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MediaId");
|
||||
|
||||
b.HasIndex("Path");
|
||||
|
||||
b.HasIndex("SoftwareVariantId");
|
||||
|
||||
b.ToTable("SoftwareVariantByCompilationMedia");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b =>
|
||||
{
|
||||
b.Property<ulong>("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned");
|
||||
@@ -4522,6 +4549,15 @@ namespace Marechai.Database.Migrations
|
||||
HasForeignKey("SoftwareVersionId").OnDelete(DeleteBehavior.Cascade).IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marechai.Database.Models.SoftwareVariantByCompilationMedia", b =>
|
||||
{
|
||||
b.HasOne("Marechai.Database.Models.Media", "Media").WithMany().HasForeignKey("MediaId").
|
||||
OnDelete(DeleteBehavior.Cascade).IsRequired();
|
||||
|
||||
b.HasOne("Marechai.Database.Models.SoftwareVariant", "SoftwareVariant").WithMany().
|
||||
HasForeignKey("SoftwareVariantId").OnDelete(DeleteBehavior.Cascade).IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marechai.Database.Models.SoftwareVersion", b =>
|
||||
{
|
||||
b.HasOne("Marechai.Database.Models.SoftwareFamily", "Family").WithMany("Versions").
|
||||
|
||||
@@ -124,6 +124,7 @@ namespace Marechai.Database.Models
|
||||
public virtual DbSet<StandaloneFile> StandaloneFiles { get; set; }
|
||||
public virtual DbSet<MasteringText> MasteringTexts { get; set; }
|
||||
public virtual DbSet<MediaTagDump> MediaTagDumps { get; set; }
|
||||
public virtual DbSet<SoftwareVariantByCompilationMedia> SoftwareVariantByCompilationMedia { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
@@ -1991,6 +1992,11 @@ namespace Marechai.Database.Models
|
||||
|
||||
entity.HasOne(e => e.MediaDump).WithMany(e => e.Tags).OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<SoftwareVariantByCompilationMedia>(entity =>
|
||||
{
|
||||
entity.HasIndex(e => e.Path);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2020 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Marechai.Database.Models
|
||||
{
|
||||
public class SoftwareVariantByCompilationMedia : BaseModel<ulong>
|
||||
{
|
||||
public string Path { get; set; }
|
||||
[DefaultValue('/')]
|
||||
public char PathSeparator { get; set; }
|
||||
[Required]
|
||||
public virtual SoftwareVariant SoftwareVariant { get; set; }
|
||||
[Required]
|
||||
public virtual Media Media { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<Version>4.0.0.1728</Version>
|
||||
<Version>4.0.0.1730</Version>
|
||||
<Company>Canary Islands Computer Museum</Company>
|
||||
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
|
||||
<Product>Canary Islands Computer Museum Website</Product>
|
||||
|
||||
Reference in New Issue
Block a user