mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add coverdiscs.
This commit is contained in:
6787
Marechai.Database/Migrations/20200611224647_AddCoverdiscs.Designer.cs
generated
Normal file
6787
Marechai.Database/Migrations/20200611224647_AddCoverdiscs.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
52
Marechai.Database/Migrations/20200611224647_AddCoverdiscs.cs
Normal file
52
Marechai.Database/Migrations/20200611224647_AddCoverdiscs.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
/******************************************************************************
|
||||
// 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 Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Marechai.Database.Migrations
|
||||
{
|
||||
public partial class AddCoverdiscs : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>("MagazineIssueId", "Media", nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex("IX_Media_MagazineIssueId", "Media", "MagazineIssueId");
|
||||
|
||||
migrationBuilder.AddForeignKey("FK_Media_MagazineIssues_MagazineIssueId", "Media", "MagazineIssueId",
|
||||
"MagazineIssues", principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey("FK_Media_MagazineIssues_MagazineIssueId", "Media");
|
||||
|
||||
migrationBuilder.DropIndex("IX_Media_MagazineIssueId", "Media");
|
||||
|
||||
migrationBuilder.DropColumn("MagazineIssueId", "Media");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2022,6 +2022,8 @@ namespace Marechai.Database.Migrations
|
||||
|
||||
b.Property<int?>("LogicalBlockSize").HasColumnType("int");
|
||||
|
||||
b.Property<long?>("MagazineIssueId").HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("Manufacturer").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
||||
|
||||
b.Property<string>("Model").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
|
||||
@@ -2068,6 +2070,8 @@ namespace Marechai.Database.Migrations
|
||||
|
||||
b.HasIndex("Firmware");
|
||||
|
||||
b.HasIndex("MagazineIssueId");
|
||||
|
||||
b.HasIndex("Manufacturer");
|
||||
|
||||
b.HasIndex("Model");
|
||||
@@ -4232,6 +4236,12 @@ namespace Marechai.Database.Migrations
|
||||
OnDelete(DeleteBehavior.Cascade).IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marechai.Database.Models.Media", b =>
|
||||
{
|
||||
b.HasOne("Marechai.Database.Models.MagazineIssue", "MagazineIssue").WithMany("Coverdiscs").
|
||||
HasForeignKey("MagazineIssueId").OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Marechai.Database.Models.MediaBySoftwareVariant", b =>
|
||||
{
|
||||
b.HasOne("Marechai.Database.Models.Media", "Media").WithMany("Software").HasForeignKey("MediaId").
|
||||
|
||||
@@ -46,5 +46,6 @@ namespace Marechai.Database.Models
|
||||
public virtual ICollection<PeopleByMagazine> People { get; set; }
|
||||
public virtual ICollection<MagazinesByMachine> Machines { get; set; }
|
||||
public virtual ICollection<MagazinesByMachineFamily> MachineFamilies { get; set; }
|
||||
public virtual ICollection<Media> Coverdiscs { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1685,6 +1685,8 @@ namespace Marechai.Database.Models
|
||||
entity.HasIndex(e => e.Model);
|
||||
entity.HasIndex(e => e.Revision);
|
||||
entity.HasIndex(e => e.Firmware);
|
||||
|
||||
entity.HasOne(d => d.MagazineIssue).WithMany(p => p.Coverdiscs).OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<LogicalPartitionsByMedia>(entity =>
|
||||
|
||||
@@ -31,31 +31,32 @@ namespace Marechai.Database.Models
|
||||
{
|
||||
public class Media : BaseModel<ulong>
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public ushort? Sequence { get; set; }
|
||||
public ushort? LastSequence { get; set; }
|
||||
public MediaType Type { get; set; }
|
||||
public int? WriteOffset { get; set; }
|
||||
public ushort? Sides { get; set; }
|
||||
public ushort? Layers { get; set; }
|
||||
public ushort? Sessions { get; set; }
|
||||
public ushort? Tracks { get; set; }
|
||||
public ulong Sectors { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public string CopyProtection { get; set; }
|
||||
public string PartNumber { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
public string Barcode { get; set; }
|
||||
public string CatalogueNumber { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public string Firmware { get; set; }
|
||||
public int? PhysicalBlockSize { get; set; }
|
||||
public int? LogicalBlockSize { get; set; }
|
||||
public JsonObject<VariableBlockSize[]> BlockSizes { get; set; }
|
||||
public StorageInterface? StorageInterface { get; set; }
|
||||
public JsonObject<OpticalDiscTrack[]> TableOfContents { get; set; }
|
||||
public string Title { get; set; }
|
||||
public ushort? Sequence { get; set; }
|
||||
public ushort? LastSequence { get; set; }
|
||||
public MediaType Type { get; set; }
|
||||
public int? WriteOffset { get; set; }
|
||||
public ushort? Sides { get; set; }
|
||||
public ushort? Layers { get; set; }
|
||||
public ushort? Sessions { get; set; }
|
||||
public ushort? Tracks { get; set; }
|
||||
public ulong Sectors { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public string CopyProtection { get; set; }
|
||||
public string PartNumber { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
public string Barcode { get; set; }
|
||||
public string CatalogueNumber { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public string Firmware { get; set; }
|
||||
public int? PhysicalBlockSize { get; set; }
|
||||
public int? LogicalBlockSize { get; set; }
|
||||
public JsonObject<VariableBlockSize[]> BlockSizes { get; set; }
|
||||
public StorageInterface? StorageInterface { get; set; }
|
||||
public JsonObject<OpticalDiscTrack[]> TableOfContents { get; set; }
|
||||
public virtual MagazineIssue MagazineIssue { get; set; }
|
||||
|
||||
public virtual ICollection<LogicalPartitionsByMedia> LogicalPartitions { get; set; }
|
||||
public virtual ICollection<MediaDump> MediaDumps { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user