mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add media tag dumps.
This commit is contained in:
6774
Marechai.Database/Migrations/20200611223854_AddMediaTagDumps.Designer.cs
generated
Normal file
6774
Marechai.Database/Migrations/20200611223854_AddMediaTagDumps.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
// 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 AddMediaTagDumps : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable("MediaTagDumps", 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),
|
||||||
|
MediaDumpId = table.Column<ulong>(nullable: false), Type = table.Column<int>(nullable: false),
|
||||||
|
FileId = table.Column<ulong>(nullable: false)
|
||||||
|
}, constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_MediaTagDumps", x => x.Id);
|
||||||
|
|
||||||
|
table.ForeignKey("FK_MediaTagDumps_Files_FileId", x => x.FileId, "Files", "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
table.ForeignKey("FK_MediaTagDumps_MediaDumps_MediaDumpId", x => x.MediaDumpId, "MediaDumps", "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_MediaTagDumps_FileId", "MediaTagDumps", "FileId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_MediaTagDumps_MediaDumpId", "MediaTagDumps", "MediaDumpId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_MediaTagDumps_Type", "MediaTagDumps", "Type");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("MediaTagDumps");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2384,6 +2384,31 @@ namespace Marechai.Database.Migrations
|
|||||||
b.ToTable("MediaFiles");
|
b.ToTable("MediaFiles");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Marechai.Database.Models.MediaTagDump", b =>
|
||||||
|
{
|
||||||
|
b.Property<ulong>("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.Property<ulong>("FileId").HasColumnType("bigint unsigned");
|
||||||
|
|
||||||
|
b.Property<ulong>("MediaDumpId").HasColumnType("bigint unsigned");
|
||||||
|
|
||||||
|
b.Property<int>("Type").HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("FileId");
|
||||||
|
|
||||||
|
b.HasIndex("MediaDumpId");
|
||||||
|
|
||||||
|
b.HasIndex("Type");
|
||||||
|
|
||||||
|
b.ToTable("MediaTagDumps");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b =>
|
modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("bigint(20)");
|
b.Property<long>("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("bigint(20)");
|
||||||
@@ -4252,6 +4277,15 @@ namespace Marechai.Database.Migrations
|
|||||||
HasForeignKey("MediaDumpId").OnDelete(DeleteBehavior.Cascade);
|
HasForeignKey("MediaDumpId").OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Marechai.Database.Models.MediaTagDump", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Marechai.Database.Models.DbFile", "File").WithMany().HasForeignKey("FileId").
|
||||||
|
OnDelete(DeleteBehavior.Cascade).IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Marechai.Database.Models.MediaDump", "MediaDump").WithMany("Tags").
|
||||||
|
HasForeignKey("MediaDumpId").OnDelete(DeleteBehavior.Cascade).IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b =>
|
modelBuilder.Entity("Marechai.Database.Models.MemoryByMachine", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Memory").HasForeignKey("MachineId").
|
b.HasOne("Marechai.Database.Models.Machine", "Machine").WithMany("Memory").HasForeignKey("MachineId").
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ namespace Marechai.Database.Models
|
|||||||
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; }
|
public virtual DbSet<MasteringText> MasteringTexts { get; set; }
|
||||||
|
public virtual DbSet<MediaTagDump> MediaTagDumps { get; set; }
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
@@ -1981,6 +1982,13 @@ namespace Marechai.Database.Models
|
|||||||
entity.HasIndex(e => e.Text);
|
entity.HasIndex(e => e.Text);
|
||||||
entity.HasOne(d => d.Media).WithMany(p => p.MasteringTexts).OnDelete(DeleteBehavior.Cascade);
|
entity.HasOne(d => d.Media).WithMany(p => p.MasteringTexts).OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<MediaTagDump>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasIndex(e => e.Type);
|
||||||
|
|
||||||
|
entity.HasOne(e => e.MediaDump).WithMany(e => e.Tags).OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,5 +40,6 @@ namespace Marechai.Database.Models
|
|||||||
public virtual MediaDumpSubchannelImage Subchannel { get; set; }
|
public virtual MediaDumpSubchannelImage Subchannel { get; set; }
|
||||||
public virtual ICollection<MediaDumpTrackImage> Tracks { get; set; }
|
public virtual ICollection<MediaDumpTrackImage> Tracks { get; set; }
|
||||||
public virtual ICollection<Dump> Dumps { get; set; }
|
public virtual ICollection<Dump> Dumps { get; set; }
|
||||||
|
public virtual ICollection<MediaTagDump> Tags { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
14
Marechai.Database/Models/MediaTagDump.cs
Normal file
14
Marechai.Database/Models/MediaTagDump.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Aaru.CommonTypes.Enums;
|
||||||
|
|
||||||
|
namespace Marechai.Database.Models
|
||||||
|
{
|
||||||
|
public class MediaTagDump : BaseModel<ulong>
|
||||||
|
{
|
||||||
|
[Required]
|
||||||
|
public virtual MediaDump MediaDump { get; set; }
|
||||||
|
public MediaTagType Type { get; set; }
|
||||||
|
[Required]
|
||||||
|
public virtual DbFile File { 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.1726</Version>
|
<Version>4.0.0.1727</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