mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add mastering texts.
This commit is contained in:
@@ -526,4 +526,11 @@ namespace Marechai.Database
|
|||||||
Unknown = 0, Retail = 1, Bundle = 2,
|
Unknown = 0, Retail = 1, Bundle = 2,
|
||||||
Oem = 3
|
Oem = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum MasteringTextType : byte
|
||||||
|
{
|
||||||
|
Unknown = 0, LotNumber = 1, MasteringSid = 2,
|
||||||
|
MouldSid = 3, MasteringCode = 4, Barcode = 5,
|
||||||
|
Toolstamp = 6
|
||||||
|
}
|
||||||
}
|
}
|
||||||
6725
Marechai.Database/Migrations/20200611221232_AddMasteringTexts.Designer.cs
generated
Normal file
6725
Marechai.Database/Migrations/20200611221232_AddMasteringTexts.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,66 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
// 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 AddMasteringTexts : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable("MasteringTexts", 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),
|
||||||
|
Type = table.Column<byte>(nullable: false), Text = table.Column<string>(nullable: false),
|
||||||
|
Side = table.Column<short>(nullable: true), Layer = table.Column<short>(nullable: true),
|
||||||
|
MediaId = table.Column<ulong>(nullable: false)
|
||||||
|
}, constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_MasteringTexts", x => x.Id);
|
||||||
|
|
||||||
|
table.ForeignKey("FK_MasteringTexts_Media_MediaId", x => x.MediaId, "Media", "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_MasteringTexts_MediaId", "MasteringTexts", "MediaId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_MasteringTexts_Text", "MasteringTexts", "Text");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_MasteringTexts_Type", "MasteringTexts", "Type");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("MasteringTexts");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1971,6 +1971,35 @@ namespace Marechai.Database.Migrations
|
|||||||
b.ToTable("marechai_db");
|
b.ToTable("marechai_db");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Marechai.Database.Models.MasteringText", b =>
|
||||||
|
{
|
||||||
|
b.Property<ulong>("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<short?>("Layer").HasColumnType("smallint");
|
||||||
|
|
||||||
|
b.Property<ulong>("MediaId").HasColumnType("bigint unsigned");
|
||||||
|
|
||||||
|
b.Property<short?>("Side").HasColumnType("smallint");
|
||||||
|
|
||||||
|
b.Property<string>("Text").IsRequired().HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
||||||
|
|
||||||
|
b.Property<byte>("Type").HasColumnType("tinyint unsigned");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("MediaId");
|
||||||
|
|
||||||
|
b.HasIndex("Text");
|
||||||
|
|
||||||
|
b.HasIndex("Type");
|
||||||
|
|
||||||
|
b.ToTable("MasteringTexts");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Marechai.Database.Models.Media", b =>
|
modelBuilder.Entity("Marechai.Database.Models.Media", b =>
|
||||||
{
|
{
|
||||||
b.Property<ulong>("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned");
|
b.Property<ulong>("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned");
|
||||||
@@ -4172,6 +4201,12 @@ namespace Marechai.Database.Migrations
|
|||||||
HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade).IsRequired();
|
HasForeignKey("MagazineId").OnDelete(DeleteBehavior.Cascade).IsRequired();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Marechai.Database.Models.MasteringText", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Marechai.Database.Models.Media", "Media").WithMany("MasteringTexts").HasForeignKey("MediaId").
|
||||||
|
OnDelete(DeleteBehavior.Cascade).IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Marechai.Database.Models.MediaBySoftwareVariant", b =>
|
modelBuilder.Entity("Marechai.Database.Models.MediaBySoftwareVariant", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Marechai.Database.Models.Media", "Media").WithMany("Software").HasForeignKey("MediaId").
|
b.HasOne("Marechai.Database.Models.Media", "Media").WithMany("Software").HasForeignKey("MediaId").
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ namespace Marechai.Database.Models
|
|||||||
public virtual DbSet<SoftwareFamily> SoftwareFamilies { get; set; }
|
public virtual DbSet<SoftwareFamily> SoftwareFamilies { get; set; }
|
||||||
public virtual DbSet<SoftwareVariant> SoftwareVariants { get; set; }
|
public virtual DbSet<SoftwareVariant> SoftwareVariants { get; set; }
|
||||||
public virtual DbSet<StandaloneFile> StandaloneFiles { get; set; }
|
public virtual DbSet<StandaloneFile> StandaloneFiles { get; set; }
|
||||||
|
public virtual DbSet<MasteringText> MasteringTexts { get; set; }
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
@@ -1973,6 +1974,13 @@ namespace Marechai.Database.Models
|
|||||||
|
|
||||||
entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Files).OnDelete(DeleteBehavior.Cascade);
|
entity.HasOne(d => d.SoftwareVariant).WithMany(p => p.Files).OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<MasteringText>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasIndex(e => e.Type);
|
||||||
|
entity.HasIndex(e => e.Text);
|
||||||
|
entity.HasOne(d => d.Media).WithMany(p => p.MasteringTexts).OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
15
Marechai.Database/Models/MasteringText.cs
Normal file
15
Marechai.Database/Models/MasteringText.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Marechai.Database.Models
|
||||||
|
{
|
||||||
|
public class MasteringText : BaseModel<ulong>
|
||||||
|
{
|
||||||
|
public MasteringTextType Type { get; set; }
|
||||||
|
[Required]
|
||||||
|
public string Text { get; set; }
|
||||||
|
public short? Side { get; set; }
|
||||||
|
public short? Layer { get; set; }
|
||||||
|
[Required]
|
||||||
|
public virtual Media Media { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -61,5 +61,6 @@ namespace Marechai.Database.Models
|
|||||||
public virtual ICollection<MediaDump> MediaDumps { get; set; }
|
public virtual ICollection<MediaDump> MediaDumps { get; set; }
|
||||||
public virtual ICollection<Dump> Dumps { get; set; }
|
public virtual ICollection<Dump> Dumps { get; set; }
|
||||||
public virtual ICollection<MediaBySoftwareVariant> Software { get; set; }
|
public virtual ICollection<MediaBySoftwareVariant> Software { get; set; }
|
||||||
|
public virtual ICollection<MasteringText> MasteringTexts { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<Version>4.0.0.1724</Version>
|
<Version>4.0.0.1726</Version>
|
||||||
<Company>Canary Islands Computer Museum</Company>
|
<Company>Canary Islands Computer Museum</Company>
|
||||||
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
|
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
|
||||||
<Product>Canary Islands Computer Museum Website</Product>
|
<Product>Canary Islands Computer Museum Website</Product>
|
||||||
|
|||||||
Reference in New Issue
Block a user