Move database context, migrations and models to separate project.

This commit is contained in:
2024-05-03 22:18:49 +01:00
parent 16d72acb6a
commit 7bcaf5b1b0
163 changed files with 415 additions and 311 deletions

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aaru.CommonTypes" Version="6.0.0-alpha8"/>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0"/>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0"/>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2"/>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,359 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Context.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Entity framework database context.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
using System.Data.Common;
using Aaru.CommonTypes.Metadata;
using Aaru.Server.Database.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using OperatingSystem = Aaru.Server.Database.Models.OperatingSystem;
using Version = Aaru.Server.Database.Models.Version;
namespace Aaru.Server.Database;
public sealed class DbContext : IdentityDbContext<IdentityUser>
{
public DbContext() {}
public DbContext(DbContextOptions<DbContext> options) : base(options) {}
public DbSet<Device> Devices { get; set; }
public DbSet<UploadedReport> Reports { get; set; }
public DbSet<Command> Commands { get; set; }
public DbSet<DeviceStat> DeviceStats { get; set; }
public DbSet<Filesystem> Filesystems { get; set; }
public DbSet<Filter> Filters { get; set; }
public DbSet<Media> Medias { get; set; }
public DbSet<MediaFormat> MediaFormats { get; set; }
public DbSet<OperatingSystem> OperatingSystems { get; set; }
public DbSet<Partition> Partitions { get; set; }
public DbSet<Version> Versions { get; set; }
public DbSet<UsbVendor> UsbVendors { get; set; }
public DbSet<UsbProduct> UsbProducts { get; set; }
public DbSet<CompactDiscOffset> CdOffsets { get; set; }
public DbSet<Ata> Ata { get; set; }
public DbSet<BlockDescriptor> BlockDescriptor { get; set; }
public DbSet<Chs> Chs { get; set; }
public DbSet<FireWire> FireWire { get; set; }
public DbSet<Mmc> Mmc { get; set; }
public DbSet<MmcSd> MmcSd { get; set; }
public DbSet<MmcFeatures> MmcFeatures { get; set; }
public DbSet<Pcmcia> Pcmcia { get; set; }
public DbSet<Scsi> Scsi { get; set; }
public DbSet<ScsiMode> ScsiMode { get; set; }
public DbSet<ScsiPage> ScsiPage { get; set; }
public DbSet<Ssc> Ssc { get; set; }
public DbSet<SupportedDensity> SupportedDensity { get; set; }
public DbSet<TestedMedia> TestedMedia { get; set; }
public DbSet<TestedSequentialMedia> TestedSequentialMedia { get; set; }
public DbSet<Usb> Usb { get; set; }
public DbSet<RemoteApplication> RemoteApplications { get; set; }
public DbSet<RemoteArchitecture> RemoteArchitectures { get; set; }
public DbSet<RemoteOperatingSystem> RemoteOperatingSystems { get; set; }
public DbSet<GdRomSwapDiscCapabilities> GdRomSwapDiscCapabilities { get; set; }
public DbSet<NesHeaderInfo> NesHeaders { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if(optionsBuilder.IsConfigured) return;
IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");
IConfigurationRoot configuration = builder.Build();
optionsBuilder
.UseMySql(configuration.GetConnectionString("DefaultConnection"),
new MariaDbServerVersion(new System.Version(10, 4, 0)))
.UseLazyLoadingProxies();
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity("Aaru.CommonTypes.Metadata.Ata",
b => b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", "ReadCapabilities")
.WithMany()
.HasForeignKey("ReadCapabilitiesId")
.OnDelete(DeleteBehavior.SetNull));
modelBuilder.Entity("Aaru.CommonTypes.Metadata.BlockDescriptor",
b => b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", null)
.WithMany("BlockDescriptors")
.HasForeignKey("ScsiModeId")
.OnDelete(DeleteBehavior.Cascade));
modelBuilder.Entity("Aaru.CommonTypes.Metadata.DensityCode",
b => b.HasOne("Aaru.CommonTypes.Metadata.SscSupportedMedia", null)
.WithMany("DensityCodes")
.HasForeignKey("SscSupportedMediaId")
.OnDelete(DeleteBehavior.Cascade));
modelBuilder.Entity("Aaru.CommonTypes.Metadata.Mmc",
b => b.HasOne("Aaru.CommonTypes.Metadata.MmcFeatures", "Features")
.WithMany()
.HasForeignKey("FeaturesId")
.OnDelete(DeleteBehavior.SetNull));
modelBuilder.Entity("Aaru.CommonTypes.Metadata.Scsi",
b =>
{
b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", "ModeSense")
.WithMany()
.HasForeignKey("ModeSenseId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Mmc", "MultiMediaDevice")
.WithMany()
.HasForeignKey("MultiMediaDeviceId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.TestedMedia", "ReadCapabilities")
.WithMany()
.HasForeignKey("ReadCapabilitiesId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Ssc", "SequentialDevice")
.WithMany()
.HasForeignKey("SequentialDeviceId")
.OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.ScsiPage",
b =>
{
b.HasOne("Aaru.CommonTypes.Metadata.Scsi", null)
.WithMany("EVPDPages")
.HasForeignKey("ScsiId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.ScsiMode", null)
.WithMany("ModePages")
.HasForeignKey("ScsiModeId")
.OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.SscSupportedMedia",
b =>
{
b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null)
.WithMany("SupportedMediaTypes")
.HasForeignKey("SscId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.TestedSequentialMedia", null)
.WithMany("SupportedMediaTypes")
.HasForeignKey("TestedSequentialMediaId")
.OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.SupportedDensity",
b =>
{
b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null)
.WithMany("SupportedDensities")
.HasForeignKey("SscId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Aaru.CommonTypes.Metadata.TestedSequentialMedia", null)
.WithMany("SupportedDensities")
.HasForeignKey("TestedSequentialMediaId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedMedia",
b =>
{
b.HasOne("Aaru.CommonTypes.Metadata.Ata", null)
.WithMany("RemovableMedias")
.HasForeignKey("AtaId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Chs", "CHS")
.WithMany()
.HasForeignKey("CHSId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Chs", "CurrentCHS")
.WithMany()
.HasForeignKey("CurrentCHSId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Mmc", null)
.WithMany("TestedMedia")
.HasForeignKey("MmcId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Aaru.CommonTypes.Metadata.Scsi", null)
.WithMany("RemovableMedias")
.HasForeignKey("ScsiId")
.OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.CommonTypes.Metadata.TestedSequentialMedia",
b => b.HasOne("Aaru.CommonTypes.Metadata.Ssc", null)
.WithMany("TestedMedia")
.HasForeignKey("SscId")
.OnDelete(DeleteBehavior.SetNull));
modelBuilder.Entity("Aaru.Server.Models.Device",
b =>
{
b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATA")
.WithMany()
.HasForeignKey("ATAId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATAPI")
.WithMany()
.HasForeignKey("ATAPIId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.Server.Models.CompactDiscOffset", "CdOffset")
.WithMany("Devices")
.HasForeignKey("CdOffsetId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.FireWire", "FireWire")
.WithMany()
.HasForeignKey("FireWireId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "MultiMediaCard")
.WithMany()
.HasForeignKey("MultiMediaCardId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Pcmcia", "PCMCIA")
.WithMany()
.HasForeignKey("PCMCIAId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Scsi", "SCSI")
.WithMany()
.HasForeignKey("SCSIId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "SecureDigital")
.WithMany()
.HasForeignKey("SecureDigitalId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Usb", "USB")
.WithMany()
.HasForeignKey("USBId")
.OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity("Aaru.Server.Models.DeviceStat",
b => b.HasOne("Aaru.Server.Models.Device", "Report")
.WithMany()
.HasForeignKey("ReportId")
.OnDelete(DeleteBehavior.SetNull));
modelBuilder.Entity("Aaru.Server.Models.UploadedReport",
b =>
{
b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATA")
.WithMany()
.HasForeignKey("ATAId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Ata", "ATAPI")
.WithMany()
.HasForeignKey("ATAPIId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.FireWire", "FireWire")
.WithMany()
.HasForeignKey("FireWireId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "MultiMediaCard")
.WithMany()
.HasForeignKey("MultiMediaCardId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Pcmcia", "PCMCIA")
.WithMany()
.HasForeignKey("PCMCIAId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Scsi", "SCSI")
.WithMany()
.HasForeignKey("SCSIId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.MmcSd", "SecureDigital")
.WithMany()
.HasForeignKey("SecureDigitalId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Aaru.CommonTypes.Metadata.Usb", "USB")
.WithMany()
.HasForeignKey("USBId")
.OnDelete(DeleteBehavior.SetNull);
});
modelBuilder.Entity<CompactDiscOffset>().HasIndex(b => b.ModifiedWhen);
modelBuilder.Entity<Device>().HasIndex(b => b.ModifiedWhen);
modelBuilder.Entity<UsbProduct>().HasIndex(b => b.ModifiedWhen);
modelBuilder.Entity<UsbProduct>().HasIndex(b => b.ProductId);
modelBuilder.Entity<UsbProduct>().HasIndex(b => b.VendorId);
modelBuilder.Entity<UsbVendor>().HasIndex(b => b.ModifiedWhen);
modelBuilder.Entity<UsbVendor>().HasIndex(b => b.VendorId).IsUnique();
modelBuilder.Entity<NesHeaderInfo>().HasIndex(b => b.ModifiedWhen);
modelBuilder.Entity<NesHeaderInfo>().HasIndex(b => b.Sha256).IsUnique();
}
internal static bool TableExists(string tableName)
{
using var db = new DbContext();
DbConnection connection = db.Database.GetDbConnection();
connection.Open();
DbCommand command = connection.CreateCommand();
command.CommandText =
$"SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME=\"{tableName}\"";
var result = (long)command.ExecuteScalar();
return result != 0;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,165 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class MakeFieldsUnsigned : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn("ProductIDSql", "Usb");
migrationBuilder.DropColumn("VendorIDSql", "Usb");
migrationBuilder.DropColumn("BlockSizeSql", "TestedMedia");
migrationBuilder.DropColumn("BlocksSql", "TestedMedia");
migrationBuilder.DropColumn("LBA48SectorsSql", "TestedMedia");
migrationBuilder.DropColumn("LBASectorsSql", "TestedMedia");
migrationBuilder.DropColumn("LogicalAlignmentSql", "TestedMedia");
migrationBuilder.DropColumn("LongBlockSizeSql", "TestedMedia");
migrationBuilder.DropColumn("NominalRotationRateSql", "TestedMedia");
migrationBuilder.DropColumn("PhysicalBlockSizeSql", "TestedMedia");
migrationBuilder.DropColumn("UnformattedBPSSql", "TestedMedia");
migrationBuilder.DropColumn("UnformattedBPTSql", "TestedMedia");
migrationBuilder.DropColumn("BitsPerMmSql", "SupportedDensity");
migrationBuilder.DropColumn("CapacitySql", "SupportedDensity");
migrationBuilder.DropColumn("TracksSql", "SupportedDensity");
migrationBuilder.DropColumn("WidthSql", "SupportedDensity");
migrationBuilder.DropColumn("LengthSql", "SscSupportedMedia");
migrationBuilder.DropColumn("WidthSql", "SscSupportedMedia");
migrationBuilder.DropColumn("MaxBlockLengthSql", "Ssc");
migrationBuilder.DropColumn("MinBlockLengthSql", "Ssc");
migrationBuilder.DropColumn("CardCodeSql", "Pcmcia");
migrationBuilder.DropColumn("ManufacturerCodeSql", "Pcmcia");
migrationBuilder.DropColumn("BlocksPerReadableUnitSql", "MmcFeatures");
migrationBuilder.DropColumn("LogicalBlockSizeSql", "MmcFeatures");
migrationBuilder.DropColumn("PhysicalInterfaceStandardNumberSql", "MmcFeatures");
migrationBuilder.DropColumn("VolumeLevelsSql", "MmcFeatures");
migrationBuilder.DropColumn("ProductIDSql", "FireWire");
migrationBuilder.DropColumn("VendorIDSql", "FireWire");
migrationBuilder.DropColumn("CylindersSql", "Chs");
migrationBuilder.DropColumn("HeadsSql", "Chs");
migrationBuilder.DropColumn("SectorsSql", "Chs");
migrationBuilder.DropColumn("BlockLengthSql", "BlockDescriptor");
migrationBuilder.DropColumn("BlocksSql", "BlockDescriptor");
migrationBuilder.AlterColumn<ushort>("VendorId", "UsbVendors", nullable: false, oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<ushort>("ProductId", "UsbProducts", nullable: false, oldClrType: typeof(int),
oldType: "int");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>("VendorId", "UsbVendors", "int", nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.AlterColumn<int>("ProductId", "UsbProducts", "int", nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.AddColumn<short>("ProductIDSql", "Usb", "smallint", nullable: false,
defaultValue: (short)0);
migrationBuilder.AddColumn<short>("VendorIDSql", "Usb", "smallint", nullable: false,
defaultValue: (short)0);
migrationBuilder.AddColumn<int>("BlockSizeSql", "TestedMedia", "int", nullable: true);
migrationBuilder.AddColumn<long>("BlocksSql", "TestedMedia", "bigint", nullable: true);
migrationBuilder.AddColumn<long>("LBA48SectorsSql", "TestedMedia", "bigint", nullable: true);
migrationBuilder.AddColumn<int>("LBASectorsSql", "TestedMedia", "int", nullable: true);
migrationBuilder.AddColumn<short>("LogicalAlignmentSql", "TestedMedia", "smallint", nullable: true);
migrationBuilder.AddColumn<int>("LongBlockSizeSql", "TestedMedia", "int", nullable: true);
migrationBuilder.AddColumn<short>("NominalRotationRateSql", "TestedMedia", "smallint", nullable: true);
migrationBuilder.AddColumn<int>("PhysicalBlockSizeSql", "TestedMedia", "int", nullable: true);
migrationBuilder.AddColumn<short>("UnformattedBPSSql", "TestedMedia", "smallint", nullable: true);
migrationBuilder.AddColumn<short>("UnformattedBPTSql", "TestedMedia", "smallint", nullable: true);
migrationBuilder.AddColumn<int>("BitsPerMmSql", "SupportedDensity", "int", nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>("CapacitySql", "SupportedDensity", "int", nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<short>("TracksSql", "SupportedDensity", "smallint", nullable: false,
defaultValue: (short)0);
migrationBuilder.AddColumn<short>("WidthSql", "SupportedDensity", "smallint", nullable: false,
defaultValue: (short)0);
migrationBuilder.AddColumn<short>("LengthSql", "SscSupportedMedia", "smallint", nullable: false,
defaultValue: (short)0);
migrationBuilder.AddColumn<short>("WidthSql", "SscSupportedMedia", "smallint", nullable: false,
defaultValue: (short)0);
migrationBuilder.AddColumn<int>("MaxBlockLengthSql", "Ssc", "int", nullable: true);
migrationBuilder.AddColumn<int>("MinBlockLengthSql", "Ssc", "int", nullable: true);
migrationBuilder.AddColumn<short>("CardCodeSql", "Pcmcia", "smallint", nullable: true);
migrationBuilder.AddColumn<short>("ManufacturerCodeSql", "Pcmcia", "smallint", nullable: true);
migrationBuilder.AddColumn<short>("BlocksPerReadableUnitSql", "MmcFeatures", "smallint", nullable: true);
migrationBuilder.AddColumn<int>("LogicalBlockSizeSql", "MmcFeatures", "int", nullable: true);
migrationBuilder.AddColumn<int>("PhysicalInterfaceStandardNumberSql", "MmcFeatures", "int", nullable: true);
migrationBuilder.AddColumn<short>("VolumeLevelsSql", "MmcFeatures", "smallint", nullable: true);
migrationBuilder.AddColumn<int>("ProductIDSql", "FireWire", "int", nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<int>("VendorIDSql", "FireWire", "int", nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<short>("CylindersSql", "Chs", "smallint", nullable: false,
defaultValue: (short)0);
migrationBuilder.AddColumn<short>("HeadsSql", "Chs", "smallint", nullable: false, defaultValue: (short)0);
migrationBuilder.AddColumn<short>("SectorsSql", "Chs", "smallint", nullable: false, defaultValue: (short)0);
migrationBuilder.AddColumn<int>("BlockLengthSql", "BlockDescriptor", "int", nullable: true);
migrationBuilder.AddColumn<long>("BlocksSql", "BlockDescriptor", "bigint", nullable: true);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,156 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class CreateIdentitySchema : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable("AspNetRoles", table => new
{
Id = table.Column<string>(),
Name = table.Column<string>(maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true)
}, constraints: table => table.PrimaryKey("PK_AspNetRoles", x => x.Id));
migrationBuilder.CreateTable("AspNetUsers", table => new
{
Id = table.Column<string>(),
UserName = table.Column<string>(maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(),
PasswordHash = table.Column<string>(nullable: true),
SecurityStamp = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
PhoneNumber = table.Column<string>(nullable: true),
PhoneNumberConfirmed = table.Column<bool>(),
TwoFactorEnabled = table.Column<bool>(),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
LockoutEnabled = table.Column<bool>(),
AccessFailedCount = table.Column<int>()
}, constraints: table => table.PrimaryKey("PK_AspNetUsers", x => x.Id));
migrationBuilder.CreateTable("AspNetRoleClaims", table => new
{
Id = table.Column<int>().
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
RoleId = table.Column<string>(),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true)
}, constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey("FK_AspNetRoleClaims_AspNetRoles_RoleId", x => x.RoleId, "AspNetRoles", "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable("AspNetUserClaims", table => new
{
Id = table.Column<int>().
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
UserId = table.Column<string>(),
ClaimType = table.Column<string>(nullable: true),
ClaimValue = table.Column<string>(nullable: true)
}, constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey("FK_AspNetUserClaims_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable("AspNetUserLogins", table => new
{
LoginProvider = table.Column<string>(maxLength: 128),
ProviderKey = table.Column<string>(maxLength: 128),
ProviderDisplayName = table.Column<string>(nullable: true),
UserId = table.Column<string>()
}, constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new
{
x.LoginProvider,
x.ProviderKey
});
table.ForeignKey("FK_AspNetUserLogins_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable("AspNetUserRoles", table => new
{
UserId = table.Column<string>(),
RoleId = table.Column<string>()
}, constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new
{
x.UserId,
x.RoleId
});
table.ForeignKey("FK_AspNetUserRoles_AspNetRoles_RoleId", x => x.RoleId, "AspNetRoles", "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey("FK_AspNetUserRoles_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable("AspNetUserTokens", table => new
{
UserId = table.Column<string>(),
LoginProvider = table.Column<string>(maxLength: 128),
Name = table.Column<string>(maxLength: 128),
Value = table.Column<string>(nullable: true)
}, constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new
{
x.UserId,
x.LoginProvider,
x.Name
});
table.ForeignKey("FK_AspNetUserTokens_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex("IX_AspNetRoleClaims_RoleId", "AspNetRoleClaims", "RoleId");
migrationBuilder.CreateIndex("RoleNameIndex", "AspNetRoles", "NormalizedName", unique: true);
migrationBuilder.CreateIndex("IX_AspNetUserClaims_UserId", "AspNetUserClaims", "UserId");
migrationBuilder.CreateIndex("IX_AspNetUserLogins_UserId", "AspNetUserLogins", "UserId");
migrationBuilder.CreateIndex("IX_AspNetUserRoles_RoleId", "AspNetUserRoles", "RoleId");
migrationBuilder.CreateIndex("EmailIndex", "AspNetUsers", "NormalizedEmail");
migrationBuilder.CreateIndex("UserNameIndex", "AspNetUsers", "NormalizedUserName", unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable("AspNetRoleClaims");
migrationBuilder.DropTable("AspNetUserClaims");
migrationBuilder.DropTable("AspNetUserLogins");
migrationBuilder.DropTable("AspNetUserRoles");
migrationBuilder.DropTable("AspNetUserTokens");
migrationBuilder.DropTable("AspNetRoles");
migrationBuilder.DropTable("AspNetUsers");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,403 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class SetAllOnDeleteSetNull : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_Ata_TestedMedia_ReadCapabilitiesId", "Ata");
migrationBuilder.DropForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", "BlockDescriptor");
migrationBuilder.DropForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", "DensityCode");
migrationBuilder.DropForeignKey("FK_Devices_Ata_ATAId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_Ata_ATAPIId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_CdOffsets_CdOffsetId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_FireWire_FireWireId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_MmcSd_MultiMediaCardId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_Pcmcia_PCMCIAId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_Scsi_SCSIId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_MmcSd_SecureDigitalId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_Usb_USBId", "Devices");
migrationBuilder.DropForeignKey("FK_DeviceStats_Devices_ReportId", "DeviceStats");
migrationBuilder.DropForeignKey("FK_Mmc_MmcFeatures_FeaturesId", "Mmc");
migrationBuilder.DropForeignKey("FK_Reports_Ata_ATAId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_Ata_ATAPIId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_FireWire_FireWireId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_MmcSd_MultiMediaCardId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_Pcmcia_PCMCIAId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_Scsi_SCSIId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_MmcSd_SecureDigitalId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_Usb_USBId", "Reports");
migrationBuilder.DropForeignKey("FK_Scsi_ScsiMode_ModeSenseId", "Scsi");
migrationBuilder.DropForeignKey("FK_Scsi_Mmc_MultiMediaDeviceId", "Scsi");
migrationBuilder.DropForeignKey("FK_Scsi_TestedMedia_ReadCapabilitiesId", "Scsi");
migrationBuilder.DropForeignKey("FK_Scsi_Ssc_SequentialDeviceId", "Scsi");
migrationBuilder.DropForeignKey("FK_ScsiPage_Scsi_ScsiId", "ScsiPage");
migrationBuilder.DropForeignKey("FK_ScsiPage_ScsiMode_ScsiModeId", "ScsiPage");
migrationBuilder.DropForeignKey("FK_SscSupportedMedia_Ssc_SscId", "SscSupportedMedia");
migrationBuilder.DropForeignKey("FK_SscSupportedMedia_TestedSequentialMedia_TestedSequentialMedi~",
"SscSupportedMedia");
migrationBuilder.DropForeignKey("FK_SupportedDensity_Ssc_SscId", "SupportedDensity");
migrationBuilder.DropForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMedia~",
"SupportedDensity");
migrationBuilder.DropForeignKey("FK_TestedMedia_Ata_AtaId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedMedia_Chs_CHSId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedMedia_Chs_CurrentCHSId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedMedia_Mmc_MmcId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedMedia_Scsi_ScsiId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedSequentialMedia_Ssc_SscId", "TestedSequentialMedia");
migrationBuilder.AddForeignKey("FK_Ata_TestedMedia_ReadCapabilitiesId", "Ata", "ReadCapabilitiesId",
"TestedMedia", principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", "BlockDescriptor", "ScsiModeId",
"ScsiMode", principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", "DensityCode",
"SscSupportedMediaId", "SscSupportedMedia", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_Ata_ATAId", "Devices", "ATAId", "Ata", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_Ata_ATAPIId", "Devices", "ATAPIId", "Ata", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_CdOffsets_CdOffsetId", "Devices", "CdOffsetId", "CdOffsets",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_FireWire_FireWireId", "Devices", "FireWireId", "FireWire",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_MmcSd_MultiMediaCardId", "Devices", "MultiMediaCardId", "MmcSd",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_Pcmcia_PCMCIAId", "Devices", "PCMCIAId", "Pcmcia",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_Scsi_SCSIId", "Devices", "SCSIId", "Scsi", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_MmcSd_SecureDigitalId", "Devices", "SecureDigitalId", "MmcSd",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Devices_Usb_USBId", "Devices", "USBId", "Usb", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_DeviceStats_Devices_ReportId", "DeviceStats", "ReportId", "Devices",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Mmc_MmcFeatures_FeaturesId", "Mmc", "FeaturesId", "MmcFeatures",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Reports_Ata_ATAId", "Reports", "ATAId", "Ata", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Reports_Ata_ATAPIId", "Reports", "ATAPIId", "Ata", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Reports_FireWire_FireWireId", "Reports", "FireWireId", "FireWire",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Reports_MmcSd_MultiMediaCardId", "Reports", "MultiMediaCardId", "MmcSd",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Reports_Pcmcia_PCMCIAId", "Reports", "PCMCIAId", "Pcmcia",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Reports_Scsi_SCSIId", "Reports", "SCSIId", "Scsi", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Reports_MmcSd_SecureDigitalId", "Reports", "SecureDigitalId", "MmcSd",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Reports_Usb_USBId", "Reports", "USBId", "Usb", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Scsi_ScsiMode_ModeSenseId", "Scsi", "ModeSenseId", "ScsiMode",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Scsi_Mmc_MultiMediaDeviceId", "Scsi", "MultiMediaDeviceId", "Mmc",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Scsi_TestedMedia_ReadCapabilitiesId", "Scsi", "ReadCapabilitiesId",
"TestedMedia", principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_Scsi_Ssc_SequentialDeviceId", "Scsi", "SequentialDeviceId", "Ssc",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_ScsiPage_Scsi_ScsiId", "ScsiPage", "ScsiId", "Scsi",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_ScsiPage_ScsiMode_ScsiModeId", "ScsiPage", "ScsiModeId", "ScsiMode",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_SscSupportedMedia_Ssc_SscId", "SscSupportedMedia", "SscId", "Ssc",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_SscSupportedMedia_TestedSequentialMedia_TestedSequentialMedi~",
"SscSupportedMedia", "TestedSequentialMediaId", "TestedSequentialMedia",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_SupportedDensity_Ssc_SscId", "SupportedDensity", "SscId", "Ssc",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMedia~",
"SupportedDensity", "TestedSequentialMediaId", "TestedSequentialMedia",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_TestedMedia_Ata_AtaId", "TestedMedia", "AtaId", "Ata",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_TestedMedia_Chs_CHSId", "TestedMedia", "CHSId", "Chs",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_TestedMedia_Chs_CurrentCHSId", "TestedMedia", "CurrentCHSId", "Chs",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_TestedMedia_Mmc_MmcId", "TestedMedia", "MmcId", "Mmc",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_TestedMedia_Scsi_ScsiId", "TestedMedia", "ScsiId", "Scsi",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_TestedSequentialMedia_Ssc_SscId", "TestedSequentialMedia", "SscId",
"Ssc", principalColumn: "Id", onDelete: ReferentialAction.SetNull);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_Ata_TestedMedia_ReadCapabilitiesId", "Ata");
migrationBuilder.DropForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", "BlockDescriptor");
migrationBuilder.DropForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", "DensityCode");
migrationBuilder.DropForeignKey("FK_Devices_Ata_ATAId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_Ata_ATAPIId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_CdOffsets_CdOffsetId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_FireWire_FireWireId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_MmcSd_MultiMediaCardId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_Pcmcia_PCMCIAId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_Scsi_SCSIId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_MmcSd_SecureDigitalId", "Devices");
migrationBuilder.DropForeignKey("FK_Devices_Usb_USBId", "Devices");
migrationBuilder.DropForeignKey("FK_DeviceStats_Devices_ReportId", "DeviceStats");
migrationBuilder.DropForeignKey("FK_Mmc_MmcFeatures_FeaturesId", "Mmc");
migrationBuilder.DropForeignKey("FK_Reports_Ata_ATAId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_Ata_ATAPIId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_FireWire_FireWireId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_MmcSd_MultiMediaCardId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_Pcmcia_PCMCIAId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_Scsi_SCSIId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_MmcSd_SecureDigitalId", "Reports");
migrationBuilder.DropForeignKey("FK_Reports_Usb_USBId", "Reports");
migrationBuilder.DropForeignKey("FK_Scsi_ScsiMode_ModeSenseId", "Scsi");
migrationBuilder.DropForeignKey("FK_Scsi_Mmc_MultiMediaDeviceId", "Scsi");
migrationBuilder.DropForeignKey("FK_Scsi_TestedMedia_ReadCapabilitiesId", "Scsi");
migrationBuilder.DropForeignKey("FK_Scsi_Ssc_SequentialDeviceId", "Scsi");
migrationBuilder.DropForeignKey("FK_ScsiPage_Scsi_ScsiId", "ScsiPage");
migrationBuilder.DropForeignKey("FK_ScsiPage_ScsiMode_ScsiModeId", "ScsiPage");
migrationBuilder.DropForeignKey("FK_SscSupportedMedia_Ssc_SscId", "SscSupportedMedia");
migrationBuilder.DropForeignKey("FK_SscSupportedMedia_TestedSequentialMedia_TestedSequentialMedi~",
"SscSupportedMedia");
migrationBuilder.DropForeignKey("FK_SupportedDensity_Ssc_SscId", "SupportedDensity");
migrationBuilder.DropForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMedia~",
"SupportedDensity");
migrationBuilder.DropForeignKey("FK_TestedMedia_Ata_AtaId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedMedia_Chs_CHSId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedMedia_Chs_CurrentCHSId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedMedia_Mmc_MmcId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedMedia_Scsi_ScsiId", "TestedMedia");
migrationBuilder.DropForeignKey("FK_TestedSequentialMedia_Ssc_SscId", "TestedSequentialMedia");
migrationBuilder.AddForeignKey("FK_Ata_TestedMedia_ReadCapabilitiesId", "Ata", "ReadCapabilitiesId",
"TestedMedia", principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", "BlockDescriptor", "ScsiModeId",
"ScsiMode", principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", "DensityCode",
"SscSupportedMediaId", "SscSupportedMedia", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_Ata_ATAId", "Devices", "ATAId", "Ata", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_Ata_ATAPIId", "Devices", "ATAPIId", "Ata", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_CdOffsets_CdOffsetId", "Devices", "CdOffsetId", "CdOffsets",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_FireWire_FireWireId", "Devices", "FireWireId", "FireWire",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_MmcSd_MultiMediaCardId", "Devices", "MultiMediaCardId", "MmcSd",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_Pcmcia_PCMCIAId", "Devices", "PCMCIAId", "Pcmcia",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_Scsi_SCSIId", "Devices", "SCSIId", "Scsi", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_MmcSd_SecureDigitalId", "Devices", "SecureDigitalId", "MmcSd",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Devices_Usb_USBId", "Devices", "USBId", "Usb", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_DeviceStats_Devices_ReportId", "DeviceStats", "ReportId", "Devices",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Mmc_MmcFeatures_FeaturesId", "Mmc", "FeaturesId", "MmcFeatures",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_Ata_ATAId", "Reports", "ATAId", "Ata", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_Ata_ATAPIId", "Reports", "ATAPIId", "Ata", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_FireWire_FireWireId", "Reports", "FireWireId", "FireWire",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_MmcSd_MultiMediaCardId", "Reports", "MultiMediaCardId", "MmcSd",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_Pcmcia_PCMCIAId", "Reports", "PCMCIAId", "Pcmcia",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_Scsi_SCSIId", "Reports", "SCSIId", "Scsi", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_MmcSd_SecureDigitalId", "Reports", "SecureDigitalId", "MmcSd",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_Usb_USBId", "Reports", "USBId", "Usb", principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Scsi_ScsiMode_ModeSenseId", "Scsi", "ModeSenseId", "ScsiMode",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Scsi_Mmc_MultiMediaDeviceId", "Scsi", "MultiMediaDeviceId", "Mmc",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Scsi_TestedMedia_ReadCapabilitiesId", "Scsi", "ReadCapabilitiesId",
"TestedMedia", principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Scsi_Ssc_SequentialDeviceId", "Scsi", "SequentialDeviceId", "Ssc",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_ScsiPage_Scsi_ScsiId", "ScsiPage", "ScsiId", "Scsi",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_ScsiPage_ScsiMode_ScsiModeId", "ScsiPage", "ScsiModeId", "ScsiMode",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_SscSupportedMedia_Ssc_SscId", "SscSupportedMedia", "SscId", "Ssc",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_SscSupportedMedia_TestedSequentialMedia_TestedSequentialMedi~",
"SscSupportedMedia", "TestedSequentialMediaId", "TestedSequentialMedia",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_SupportedDensity_Ssc_SscId", "SupportedDensity", "SscId", "Ssc",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMedia~",
"SupportedDensity", "TestedSequentialMediaId", "TestedSequentialMedia",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_TestedMedia_Ata_AtaId", "TestedMedia", "AtaId", "Ata",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_TestedMedia_Chs_CHSId", "TestedMedia", "CHSId", "Chs",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_TestedMedia_Chs_CurrentCHSId", "TestedMedia", "CurrentCHSId", "Chs",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_TestedMedia_Mmc_MmcId", "TestedMedia", "MmcId", "Mmc",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_TestedMedia_Scsi_ScsiId", "TestedMedia", "ScsiId", "Scsi",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_TestedSequentialMedia_Ssc_SscId", "TestedSequentialMedia", "SscId",
"Ssc", principalColumn: "Id", onDelete: ReferentialAction.Restrict);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class CascadeDeleteDensityCodes : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", "DensityCode");
migrationBuilder.AddForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", "DensityCode",
"SscSupportedMediaId", "SscSupportedMedia", principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", "DensityCode");
migrationBuilder.AddForeignKey("FK_DensityCode_SscSupportedMedia_SscSupportedMediaId", "DensityCode",
"SscSupportedMediaId", "SscSupportedMedia", principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class CascadeDeleteBlockDescriptors : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", "BlockDescriptor");
migrationBuilder.AddForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", "BlockDescriptor", "ScsiModeId",
"ScsiMode", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", "BlockDescriptor");
migrationBuilder.AddForeignKey("FK_BlockDescriptor_ScsiMode_ScsiModeId", "BlockDescriptor", "ScsiModeId",
"ScsiMode", principalColumn: "Id", onDelete: ReferentialAction.SetNull);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class CascadeDeleteMmcFeatures : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_TestedMedia_Mmc_MmcId", "TestedMedia");
migrationBuilder.AddForeignKey("FK_TestedMedia_Mmc_MmcId", "TestedMedia", "MmcId", "Mmc",
principalColumn: "Id", onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_TestedMedia_Mmc_MmcId", "TestedMedia");
migrationBuilder.AddForeignKey("FK_TestedMedia_Mmc_MmcId", "TestedMedia", "MmcId", "Mmc",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class CascadeDeleteSupportedDensities : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_SupportedDensity_Ssc_SscId", "SupportedDensity");
migrationBuilder.DropForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMedia~",
"SupportedDensity");
migrationBuilder.AddForeignKey("FK_SupportedDensity_Ssc_SscId", "SupportedDensity", "SscId", "Ssc",
principalColumn: "Id", onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMedia~",
"SupportedDensity", "TestedSequentialMediaId", "TestedSequentialMedia",
principalColumn: "Id", onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_SupportedDensity_Ssc_SscId", "SupportedDensity");
migrationBuilder.DropForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMedia~",
"SupportedDensity");
migrationBuilder.AddForeignKey("FK_SupportedDensity_Ssc_SscId", "SupportedDensity", "SscId", "Ssc",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey("FK_SupportedDensity_TestedSequentialMedia_TestedSequentialMedia~",
"SupportedDensity", "TestedSequentialMediaId", "TestedSequentialMedia",
principalColumn: "Id", onDelete: ReferentialAction.SetNull);
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class AddSupportsScrambledReadCd : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>("CanReadCdScrambled", "TestedMedia", nullable: true);
migrationBuilder.AddColumn<byte[]>("ReadCdScrambledData", "TestedMedia", nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn("CanReadCdScrambled", "TestedMedia");
migrationBuilder.DropColumn("ReadCdScrambledData", "TestedMedia");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class NameCountModel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder) =>
migrationBuilder.Sql("ALTER TABLE Versions CHANGE `Value` `Name` LONGTEXT");
protected override void Down(MigrationBuilder migrationBuilder) =>
migrationBuilder.Sql("ALTER TABLE Versions CHANGE `Name` `Value` LONGTEXT");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class RemoteStatistics : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable("RemoteApplications", table => new
{
Id = table.Column<int>().
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(nullable: true),
Version = table.Column<string>(nullable: true),
Count = table.Column<long>()
}, constraints: table => table.PrimaryKey("PK_RemoteApplications", x => x.Id));
migrationBuilder.CreateTable("RemoteArchitectures", table => new
{
Id = table.Column<int>().
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(nullable: true),
Count = table.Column<long>()
}, constraints: table => table.PrimaryKey("PK_RemoteArchitectures", x => x.Id));
migrationBuilder.CreateTable("RemoteOperatingSystems", table => new
{
Id = table.Column<int>().
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(nullable: true),
Version = table.Column<string>(nullable: true),
Count = table.Column<long>()
}, constraints: table => table.PrimaryKey("PK_RemoteOperatingSystems", x => x.Id));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable("RemoteApplications");
migrationBuilder.DropTable("RemoteArchitectures");
migrationBuilder.DropTable("RemoteOperatingSystems");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,161 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class AddGdRomSwapDiscCapabilities : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>("GdRomSwapDiscCapabilitiesId", "Reports", nullable: true);
migrationBuilder.AddColumn<int>("GdRomSwapDiscCapabilitiesId", "Devices", nullable: true);
migrationBuilder.CreateTable("GdRomSwapDiscCapabilities", table => new
{
Id = table.Column<int>(nullable: false).
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
RecognizedSwapDisc = table.Column<bool>(nullable: false),
SwapDiscLeadOutPMIN = table.Column<byte>(nullable: false),
SwapDiscLeadOutPSEC = table.Column<byte>(nullable: false),
SwapDiscLeadOutPFRAM = table.Column<byte>(nullable: false),
SwapDiscLeadOutStart = table.Column<int>(nullable: false),
Lba0Readable = table.Column<bool>(nullable: false),
Lba0Data = table.Column<byte[]>(nullable: true),
Lba0Sense = table.Column<byte[]>(nullable: true),
Lba0DecodedSense = table.Column<string>(nullable: true),
Lba0ScrambledReadable = table.Column<bool>(nullable: false),
Lba0ScrambledData = table.Column<byte[]>(nullable: true),
Lba0ScrambledSense = table.Column<byte[]>(nullable: true),
Lba0ScrambledDecodedSense = table.Column<string>(nullable: true),
Lba44990Readable = table.Column<bool>(nullable: false),
Lba44990Data = table.Column<byte[]>(nullable: true),
Lba44990Sense = table.Column<byte[]>(nullable: true),
Lba44990DecodedSense = table.Column<string>(nullable: true),
Lba44990ReadableCluster = table.Column<int>(nullable: false),
Lba45000Readable = table.Column<bool>(nullable: false),
Lba45000Data = table.Column<byte[]>(nullable: true),
Lba45000Sense = table.Column<byte[]>(nullable: true),
Lba45000DecodedSense = table.Column<string>(nullable: true),
Lba45000ReadableCluster = table.Column<int>(nullable: false),
Lba50000Readable = table.Column<bool>(nullable: false),
Lba50000Data = table.Column<byte[]>(nullable: true),
Lba50000Sense = table.Column<byte[]>(nullable: true),
Lba50000DecodedSense = table.Column<string>(nullable: true),
Lba50000ReadableCluster = table.Column<int>(nullable: false),
Lba100000Readable = table.Column<bool>(nullable: false),
Lba100000Data = table.Column<byte[]>(nullable: true),
Lba100000Sense = table.Column<byte[]>(nullable: true),
Lba100000DecodedSense = table.Column<string>(nullable: true),
Lba100000ReadableCluster = table.Column<int>(nullable: false),
Lba400000Readable = table.Column<bool>(nullable: false),
Lba400000Data = table.Column<byte[]>(nullable: true),
Lba400000Sense = table.Column<byte[]>(nullable: true),
Lba400000DecodedSense = table.Column<string>(nullable: true),
Lba400000ReadableCluster = table.Column<int>(nullable: false),
Lba450000Readable = table.Column<bool>(nullable: false),
Lba450000Data = table.Column<byte[]>(nullable: true),
Lba450000Sense = table.Column<byte[]>(nullable: true),
Lba450000DecodedSense = table.Column<string>(nullable: true),
Lba450000ReadableCluster = table.Column<int>(nullable: false),
Lba44990PqReadable = table.Column<bool>(nullable: false),
Lba44990PqData = table.Column<byte[]>(nullable: true),
Lba44990PqSense = table.Column<byte[]>(nullable: true),
Lba44990PqDecodedSense = table.Column<string>(nullable: true),
Lba44990PqReadableCluster = table.Column<int>(nullable: false),
Lba45000PqReadable = table.Column<bool>(nullable: false),
Lba45000PqData = table.Column<byte[]>(nullable: true),
Lba45000PqSense = table.Column<byte[]>(nullable: true),
Lba45000PqDecodedSense = table.Column<string>(nullable: true),
Lba45000PqReadableCluster = table.Column<int>(nullable: false),
Lba50000PqReadable = table.Column<bool>(nullable: false),
Lba50000PqData = table.Column<byte[]>(nullable: true),
Lba50000PqSense = table.Column<byte[]>(nullable: true),
Lba50000PqDecodedSense = table.Column<string>(nullable: true),
Lba50000PqReadableCluster = table.Column<int>(nullable: false),
Lba100000PqReadable = table.Column<bool>(nullable: false),
Lba100000PqData = table.Column<byte[]>(nullable: true),
Lba100000PqSense = table.Column<byte[]>(nullable: true),
Lba100000PqDecodedSense = table.Column<string>(nullable: true),
Lba100000PqReadableCluster = table.Column<int>(nullable: false),
Lba400000PqReadable = table.Column<bool>(nullable: false),
Lba400000PqData = table.Column<byte[]>(nullable: true),
Lba400000PqSense = table.Column<byte[]>(nullable: true),
Lba400000PqDecodedSense = table.Column<string>(nullable: true),
Lba400000PqReadableCluster = table.Column<int>(nullable: false),
Lba450000PqReadable = table.Column<bool>(nullable: false),
Lba450000PqData = table.Column<byte[]>(nullable: true),
Lba450000PqSense = table.Column<byte[]>(nullable: true),
Lba450000PqDecodedSense = table.Column<string>(nullable: true),
Lba450000PqReadableCluster = table.Column<int>(nullable: false),
Lba44990RwReadable = table.Column<bool>(nullable: false),
Lba44990RwData = table.Column<byte[]>(nullable: true),
Lba44990RwSense = table.Column<byte[]>(nullable: true),
Lba44990RwDecodedSense = table.Column<string>(nullable: true),
Lba44990RwReadableCluster = table.Column<int>(nullable: false),
Lba45000RwReadable = table.Column<bool>(nullable: false),
Lba45000RwData = table.Column<byte[]>(nullable: true),
Lba45000RwSense = table.Column<byte[]>(nullable: true),
Lba45000RwDecodedSense = table.Column<string>(nullable: true),
Lba45000RwReadableCluster = table.Column<int>(nullable: false),
Lba50000RwReadable = table.Column<bool>(nullable: false),
Lba50000RwData = table.Column<byte[]>(nullable: true),
Lba50000RwSense = table.Column<byte[]>(nullable: true),
Lba50000RwDecodedSense = table.Column<string>(nullable: true),
Lba50000RwReadableCluster = table.Column<int>(nullable: false),
Lba100000RwReadable = table.Column<bool>(nullable: false),
Lba100000RwData = table.Column<byte[]>(nullable: true),
Lba100000RwSense = table.Column<byte[]>(nullable: true),
Lba100000RwDecodedSense = table.Column<string>(nullable: true),
Lba100000RwReadableCluster = table.Column<int>(nullable: false),
Lba400000RwReadable = table.Column<bool>(nullable: false),
Lba400000RwData = table.Column<byte[]>(nullable: true),
Lba400000RwSense = table.Column<byte[]>(nullable: true),
Lba400000RwDecodedSense = table.Column<string>(nullable: true),
Lba400000RwReadableCluster = table.Column<int>(nullable: false),
Lba450000RwReadable = table.Column<bool>(nullable: false),
Lba450000RwData = table.Column<byte[]>(nullable: true),
Lba450000RwSense = table.Column<byte[]>(nullable: true),
Lba450000RwDecodedSense = table.Column<string>(nullable: true),
Lba450000RwReadableCluster = table.Column<int>(nullable: false),
MinimumReadableSectorInHdArea = table.Column<uint>(nullable: false),
MaximumReadableSectorInHdArea = table.Column<uint>(nullable: false),
MaximumReadablePqInHdArea = table.Column<byte[]>(nullable: true),
MaximumReadableRwInHdArea = table.Column<byte[]>(nullable: true)
}, constraints: table => table.PrimaryKey("PK_GdRomSwapDiscCapabilities", x => x.Id));
migrationBuilder.CreateIndex("IX_Reports_GdRomSwapDiscCapabilitiesId", "Reports",
"GdRomSwapDiscCapabilitiesId");
migrationBuilder.CreateIndex("IX_Devices_GdRomSwapDiscCapabilitiesId", "Devices",
"GdRomSwapDiscCapabilitiesId");
migrationBuilder.AddForeignKey("FK_Devices_GdRomSwapDiscCapabilities_GdRomSwapDiscCapabilitiesId",
"Devices", "GdRomSwapDiscCapabilitiesId", "GdRomSwapDiscCapabilities",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey("FK_Reports_GdRomSwapDiscCapabilities_GdRomSwapDiscCapabilitiesId",
"Reports", "GdRomSwapDiscCapabilitiesId", "GdRomSwapDiscCapabilities",
principalColumn: "Id", onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_Devices_GdRomSwapDiscCapabilities_GdRomSwapDiscCapabilitiesId",
"Devices");
migrationBuilder.DropForeignKey("FK_Reports_GdRomSwapDiscCapabilities_GdRomSwapDiscCapabilitiesId",
"Reports");
migrationBuilder.DropTable("GdRomSwapDiscCapabilities");
migrationBuilder.DropIndex("IX_Reports_GdRomSwapDiscCapabilitiesId", "Reports");
migrationBuilder.DropIndex("IX_Devices_GdRomSwapDiscCapabilitiesId", "Devices");
migrationBuilder.DropColumn("GdRomSwapDiscCapabilitiesId", "Reports");
migrationBuilder.DropColumn("GdRomSwapDiscCapabilitiesId", "Devices");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class AddCanReadGdRomUsingSwapDisc : Migration
{
protected override void Up(MigrationBuilder migrationBuilder) =>
migrationBuilder.AddColumn<bool>("CanReadGdRomUsingSwapDisc", "Devices", nullable: true,
defaultValue: null);
protected override void Down(MigrationBuilder migrationBuilder) =>
migrationBuilder.DropColumn("CanReadGdRomUsingSwapDisc", "Devices");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,432 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class AddAudioFieldsToGdromReadCapabilities : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<byte[]>("Lba100000AudioData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba100000AudioDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba100000AudioPqData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba100000AudioPqDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba100000AudioPqReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba100000AudioPqReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba100000AudioPqSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<bool>("Lba100000AudioReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba100000AudioReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba100000AudioRwData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba100000AudioRwDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba100000AudioRwReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba100000AudioRwReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba100000AudioRwSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba100000AudioSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba400000AudioAudioData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba400000AudioDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba400000AudioPqData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba400000AudioPqDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba400000AudioPqReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba400000AudioPqReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba400000AudioPqSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<bool>("Lba400000AudioReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba400000AudioReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba400000AudioRwData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba400000AudioRwDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba400000AudioRwReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba400000AudioRwReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba400000AudioRwSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba400000AudioSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba44990AudioData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba44990AudioDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba44990AudioPqData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba44990AudioPqDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba44990AudioPqReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba44990AudioPqReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba44990AudioPqSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<bool>("Lba44990AudioReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba44990AudioReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba44990AudioRwData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba44990AudioRwDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba44990AudioRwReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba44990AudioRwReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba44990AudioRwSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba44990AudioSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba450000AudioData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba450000AudioDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba450000AudioPqData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba450000AudioPqDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba450000AudioPqReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba450000AudioPqReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba450000AudioPqSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<bool>("Lba450000AudioReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba450000AudioReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba450000AudioRwData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba450000AudioRwDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba450000AudioRwReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba450000AudioRwReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba450000AudioRwSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba450000AudioSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba45000AudioData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba45000AudioDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba45000AudioPqData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba45000AudioPqDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba45000AudioPqReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba45000AudioPqReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba45000AudioPqSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<bool>("Lba45000AudioReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba45000AudioReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba45000AudioRwData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba45000AudioRwDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba45000AudioRwReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba45000AudioRwReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba45000AudioRwSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba45000AudioSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba50000AudioData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba50000AudioDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba50000AudioPqData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba50000AudioPqDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba50000AudioPqReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba50000AudioPqReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba50000AudioPqSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<bool>("Lba50000AudioReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba50000AudioReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba50000AudioRwData", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<string>("Lba50000AudioRwDecodedSense", "GdRomSwapDiscCapabilities",
nullable: true);
migrationBuilder.AddColumn<bool>("Lba50000AudioRwReadable", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>("Lba50000AudioRwReadableCluster", "GdRomSwapDiscCapabilities",
nullable: false, defaultValue: 0);
migrationBuilder.AddColumn<byte[]>("Lba50000AudioRwSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<byte[]>("Lba50000AudioSense", "GdRomSwapDiscCapabilities", nullable: true);
migrationBuilder.AddColumn<bool>("TestCrashed", "GdRomSwapDiscCapabilities", nullable: false,
defaultValue: false);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn("Lba100000AudioData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioPqData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioPqDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioPqReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioPqReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioPqSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioRwData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioRwDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioRwReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioRwReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioRwSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba100000AudioSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioAudioData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioPqData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioPqDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioPqReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioPqReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioPqSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioRwData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioRwDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioRwReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioRwReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioRwSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba400000AudioSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioPqData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioPqDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioPqReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioPqReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioPqSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioRwData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioRwDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioRwReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioRwReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioRwSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba44990AudioSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioPqData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioPqDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioPqReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioPqReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioPqSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioRwData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioRwDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioRwReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioRwReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioRwSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba450000AudioSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioPqData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioPqDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioPqReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioPqReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioPqSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioRwData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioRwDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioRwReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioRwReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioRwSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba45000AudioSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioPqData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioPqDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioPqReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioPqReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioPqSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioRwData", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioRwDecodedSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioRwReadable", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioRwReadableCluster", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioRwSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("Lba50000AudioSense", "GdRomSwapDiscCapabilities");
migrationBuilder.DropColumn("TestCrashed", "GdRomSwapDiscCapabilities");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class AddFieldsForF1hCommand06hSubcommand : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>("CanReadF1_06", "TestedMedia", nullable: true);
migrationBuilder.AddColumn<bool>("CanReadF1_06LeadOut", "TestedMedia", nullable: true);
migrationBuilder.AddColumn<byte[]>("ReadF1_06Data", "TestedMedia", nullable: true);
migrationBuilder.AddColumn<byte[]>("ReadF1_06LeadOutData", "TestedMedia", nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn("CanReadF1_06", "TestedMedia");
migrationBuilder.DropColumn("CanReadF1_06LeadOut", "TestedMedia");
migrationBuilder.DropColumn("ReadF1_06Data", "TestedMedia");
migrationBuilder.DropColumn("ReadF1_06LeadOutData", "TestedMedia");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Aaru.Server.Database.Migrations
{
public partial class FixGdRomCapabilitiesFieldName : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn("Lba400000AudioAudioData", "GdRomSwapDiscCapabilities");
migrationBuilder.AddColumn<byte[]>("Lba400000AudioData", "GdRomSwapDiscCapabilities", nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn("Lba400000AudioData", "GdRomSwapDiscCapabilities");
migrationBuilder.AddColumn<byte[]>("Lba400000AudioAudioData", "GdRomSwapDiscCapabilities", "longblob",
nullable: true);
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
using System.ComponentModel.DataAnnotations;
namespace Aaru.Server.Database.Models;
public abstract class BaseModel<T>
{
[Key]
public T Id { get; set; }
}

View File

@@ -0,0 +1,40 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : OperatingSystem.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing operating system statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public abstract class BaseOperatingSystem : BaseModel<int>
{
public string Name { get; set; }
public string Version { get; set; }
public long Count { get; set; }
}

View File

@@ -0,0 +1,71 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : CdOffset.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing Compact Disc read offsets in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
using System.ComponentModel;
using Aaru.CommonTypes.Metadata;
namespace Aaru.Server.Database.Models;
public class CompactDiscOffset : CdOffset
{
public CompactDiscOffset() {}
public CompactDiscOffset(string manufacturer, string model, short offset, int submissions, float agreement)
{
Manufacturer = manufacturer;
Model = model;
Offset = offset;
Submissions = submissions;
Agreement = agreement;
AddedWhen = ModifiedWhen = DateTime.UtcNow;
}
public CompactDiscOffset(CdOffset offset)
{
Manufacturer = offset.Manufacturer;
Model = offset.Model;
Offset = offset.Offset;
Submissions = offset.Submissions;
Agreement = offset.Agreement;
AddedWhen = ModifiedWhen = DateTime.UtcNow;
}
public int Id { get; set; }
[DisplayName("Added date")]
public DateTime AddedWhen { get; set; }
[DisplayName("Modification date")]
public DateTime ModifiedWhen { get; set; }
public virtual ICollection<Device> Devices { get; set; }
}

View File

@@ -0,0 +1,14 @@
namespace Aaru.Server.Database.Models;
public class ChsModel
{
public ushort Cylinders { get; set; }
public ushort Heads { get; set; }
public ushort Sectors { get; set; }
}
public class ChsModelForView
{
public List<ChsModel> List { get; set; }
public string Json { get; set; }
}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Command.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing command statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class Command : NameCountModel<int> {}

View File

@@ -0,0 +1,13 @@
namespace Aaru.Server.Database.Models;
public class CompareModel
{
public int LeftId { get; set; }
public int RightId { get; set; }
public List<string> ValueNames { get; set; }
public List<string> LeftValues { get; set; }
public List<string> RightValues { get; set; }
public bool HasError { get; set; }
public string ErrorMessage { get; set; }
public bool AreEqual { get; set; }
}

View File

@@ -0,0 +1,110 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Device.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing processed device reports in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
using System.ComponentModel;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Metadata;
namespace Aaru.Server.Database.Models;
public class Device : DeviceReportV2
{
public Device() => AddedWhen = DateTime.UtcNow;
public Device(DeviceReportV2 report)
{
ATA = report.ATA;
ATAPI = report.ATAPI;
CompactFlash = report.CompactFlash;
FireWire = report.FireWire;
AddedWhen = DateTime.UtcNow;
ModifiedWhen = DateTime.UtcNow;
MultiMediaCard = report.MultiMediaCard;
PCMCIA = report.PCMCIA;
SCSI = report.SCSI;
SecureDigital = report.SecureDigital;
USB = report.USB;
Manufacturer = report.Manufacturer;
Model = report.Model;
Revision = report.Revision;
Type = report.Type;
GdRomSwapDiscCapabilities = report.GdRomSwapDiscCapabilities;
}
public Device(int? ataId, int? atapiId, int? firewireId, int? multimediacardId, int? pcmciaId, int? securedigitalId,
int? scsiId, int? usbId, DateTime uploadedWhen, string manufacturer, string model, string revision,
bool compactFlash, DeviceType type, int? gdRomSwapDiscCapabilitiesId)
{
ATAId = ataId;
ATAPIId = atapiId;
FireWireId = firewireId;
MultiMediaCardId = multimediacardId;
PCMCIAId = pcmciaId;
SecureDigitalId = securedigitalId;
SCSIId = scsiId;
USBId = usbId;
AddedWhen = uploadedWhen;
ModifiedWhen = DateTime.UtcNow;
Manufacturer = manufacturer;
Model = model;
Revision = revision;
CompactFlash = compactFlash;
Type = type;
GdRomSwapDiscCapabilitiesId = gdRomSwapDiscCapabilitiesId;
}
[DisplayName("Added when")]
public DateTime AddedWhen { get; set; }
[DisplayName("Modified when")]
public DateTime? ModifiedWhen { get; set; }
public virtual CompactDiscOffset CdOffset { get; set; }
[DefaultValue(0)]
[DisplayName("Optimal no. of sectors to be read at once")]
public int OptimalMultipleSectorsRead { get; set; }
[DefaultValue(null)]
[DisplayName("Can read GD-ROM using swap disc trick")]
public bool? CanReadGdRomUsingSwapDisc { get; set; }
public int? ATAId { get; set; }
public int? ATAPIId { get; set; }
public int? FireWireId { get; set; }
public int? MultiMediaCardId { get; set; }
public int? PCMCIAId { get; set; }
public int? SecureDigitalId { get; set; }
public int? SCSIId { get; set; }
public int? USBId { get; set; }
public int? GdRomSwapDiscCapabilitiesId { get; set; }
}

View File

@@ -0,0 +1,17 @@
using Aaru.CommonTypes.Metadata;
namespace Aaru.Server.Database.Models;
public class DeviceDetails
{
public Device Report { get; set; }
public List<int> SameAll { get; set; }
public List<int> SameButManufacturer { get; set; }
public List<int> ReportAll { get; set; }
public List<int> ReportButManufacturer { get; set; }
public List<DeviceStat> StatsAll { get; set; }
public List<DeviceStat> StatsButManufacturer { get; set; }
public int ReadCapabilitiesId { get; set; }
public List<TestedMedia> TestedMedias { get; set; }
public List<TestedSequentialMedia> TestedSequentialMedias { get; set; }
}

View File

@@ -0,0 +1,42 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : DeviceItem.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for showing device statistics.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class DeviceItem
{
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Revision { get; set; }
public string Bus { get; set; }
public int ReportId { get; set; }
}

View File

@@ -0,0 +1,42 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : DeviceStat.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing device statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class DeviceStat : BaseModel<int>
{
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Revision { get; set; }
public string Bus { get; set; }
public virtual Device Report { get; set; }
}

View File

@@ -0,0 +1,8 @@
namespace Aaru.Server.Database.Models;
public class ErrorViewModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Filesystem.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing filesystem statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class Filesystem : NameCountModel<int> {}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Filter.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing filter statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class Filter : NameCountModel<int> {}

View File

@@ -0,0 +1,10 @@
namespace Aaru.Server.Database.Models;
public class FindReportModel : BaseModel<int>
{
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Revision { get; set; }
public string Bus { get; set; }
public List<Device> LikeDevices { get; set; }
}

View File

@@ -0,0 +1,30 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Aaru.Server.Database.Models;
public class FireWireModel
{
[DisplayName("Vendor ID")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0x{0:X8}")]
public uint VendorID { get; set; }
[DisplayName("Product ID")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0x{0:X8}")]
public uint ProductID { get; set; }
[DisplayFormat(NullDisplayText = "Unknown")]
public string Manufacturer { get; set; }
[DisplayFormat(NullDisplayText = "Unknown")]
public string Product { get; set; }
[DisplayName("Is media removable?")]
public bool RemovableMedia { get; set; }
}
public class FireWireModelForView
{
public List<FireWireModel> List { get; set; }
public string Json { get; set; }
}

View File

@@ -0,0 +1,14 @@
namespace Aaru.Server.Database.Models;
public class IdHashModel : BaseModel<int>
{
public IdHashModel(int id, string hash)
{
Id = id;
Hash = hash;
}
public string Hash { get; set; }
public string Description { get; set; }
public int[] Duplicates { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Aaru.Server.Database.Models;
public class IdHashModelForView
{
public List<IdHashModel> List { get; set; }
public string Json { get; set; }
}

View File

@@ -0,0 +1,78 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Media.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing media type statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Aaru.CommonTypes;
namespace Aaru.Server.Database.Models;
public class Media : BaseModel<int>
{
[NotMapped]
(string type, string subType) _mediaType;
public string Type { get; set; }
public bool Real { get; set; }
public long Count { get; set; }
[NotMapped]
(string type, string subType) MediaType
{
get
{
if(_mediaType != default((string type, string subType))) return _mediaType;
try
{
if(Enum.TryParse(Type, out MediaType enumMediaType))
_mediaType = CommonTypes.Metadata.MediaType.MediaTypeToString(enumMediaType);
else if(int.TryParse(Type, out int asInt))
_mediaType = CommonTypes.Metadata.MediaType.MediaTypeToString((MediaType)asInt);
}
catch
{
// Could not get media type/subtype pair from type, so just leave it as is
}
return _mediaType;
}
}
[NotMapped]
[DisplayName("Physical type")]
public string PhysicalType => MediaType.type;
[NotMapped]
[DisplayName("Logical type")]
public string LogicalType => MediaType.subType;
}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : MediaFormat.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing media image format statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class MediaFormat : NameCountModel<int> {}

View File

@@ -0,0 +1,40 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : MediaItem.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for showing media type statistics.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class MediaItem
{
public string Type { get; set; }
public string SubType { get; set; }
public long Count { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Aaru.Server.Database.Models;
public class MmcModelForView : BaseModel<int>
{
[DisplayFormat(NullDisplayText = "none")]
[DisplayName("MMC FEATURES ID")]
public int? FeaturesId { get; set; }
[DisplayName("Response length (bytes)")]
public int DataLength { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Aaru.Server.Database.Models;
public abstract class NameCountModel<T> : BaseModel<T>
{
public string Name { get; set; }
public long Count { get; set; }
}

View File

@@ -0,0 +1,51 @@
using System.ComponentModel.DataAnnotations;
using Aaru.CommonTypes.Enums;
namespace Aaru.Server.Database.Models;
public class NesHeaderInfo : BaseModel<int>
{
/// <summary>ROM hash</summary>
[StringLength(64)]
[Required]
public string Sha256 { get; set; }
/// <summary>If <c>true</c> vertical mirroring is hard-wired, horizontal or mapper defined otherwise</summary>
public bool NametableMirroring { get; set; }
/// <summary>If <c>true</c> a battery is present</summary>
public bool BatteryPresent { get; set; }
/// <summary>If <c>true</c> the four player screen mode is hardwired</summary>
public bool FourScreenMode { get; set; }
/// <summary>Mapper number (NES 2.0 when in conflict)</summary>
public ushort Mapper { get; set; }
/// <summary>Console type</summary>
public NesConsoleType ConsoleType { get; set; }
/// <summary>Submapper number</summary>
public byte Submapper { get; set; }
/// <summary>Timing mode</summary>
public NesTimingMode TimingMode { get; set; }
/// <summary>Vs. PPU type</summary>
public NesVsPpuType VsPpuType { get; set; }
/// <summary>Vs. hardware type</summary>
public NesVsHardwareType VsHardwareType { get; set; }
/// <summary>Extended console type</summary>
public NesExtendedConsoleType ExtendedConsoleType { get; set; }
/// <summary>Default expansion device</summary>
public NesDefaultExpansionDevice DefaultExpansionDevice { get; set; }
/// <summary>Date when model has been added to the database</summary>
public DateTime AddedWhen { get; set; }
/// <summary>Date when model was last modified</summary>
public DateTime ModifiedWhen { get; set; }
}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : OperatingSystem.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing operating system statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class OperatingSystem : BaseOperatingSystem {}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Partition.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing partition statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class Partition : NameCountModel<int> {}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : RemoteApplication.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing remote application statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class RemoteApplication : BaseOperatingSystem {}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : RemoteArchitecture.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing remote architecture statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class RemoteArchitecture : NameCountModel<int> {}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : RemoteOperatingSystem.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing remote operating system statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class RemoteOperatingSystem : BaseOperatingSystem {}

View File

@@ -0,0 +1,14 @@
namespace Aaru.Server.Database.Models;
public class SscModel
{
public byte? BlockSizeGranularity { get; set; }
public uint? MaxBlockLength { get; set; }
public uint? MinBlockLength { get; set; }
}
public class SscModelForView
{
public List<SscModel> List { get; set; }
public string Json { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace Aaru.Server.Database.Models;
public class TestedMediaDataModel
{
public int TestedMediaId { get; set; }
public string DataName { get; set; }
public string RawDataAsHex { get; set; }
public string Decoded { get; set; }
}

View File

@@ -0,0 +1,73 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : UploadedReport.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing uploaded device reports in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
using System.ComponentModel;
using Aaru.CommonTypes.Metadata;
namespace Aaru.Server.Database.Models;
public class UploadedReport : DeviceReportV2
{
public UploadedReport() => UploadedWhen = DateTime.UtcNow;
public UploadedReport(DeviceReportV2 report)
{
ATA = report.ATA;
ATAPI = report.ATAPI;
CompactFlash = report.CompactFlash;
FireWire = report.FireWire;
UploadedWhen = DateTime.UtcNow;
MultiMediaCard = report.MultiMediaCard;
PCMCIA = report.PCMCIA;
SCSI = report.SCSI;
SecureDigital = report.SecureDigital;
USB = report.USB;
Manufacturer = report.Manufacturer;
Model = report.Model;
Revision = report.Revision;
Type = report.Type;
GdRomSwapDiscCapabilities = report.GdRomSwapDiscCapabilities;
}
[DisplayName("Uploaded when")]
public DateTime UploadedWhen { get; set; }
public int? ATAId { get; set; }
public int? ATAPIId { get; set; }
public int? FireWireId { get; set; }
public int? MultiMediaCardId { get; set; }
public int? PCMCIAId { get; set; }
public int? SecureDigitalId { get; set; }
public int? SCSIId { get; set; }
public int? USBId { get; set; }
public int? GdRomSwapDiscCapabilitiesId { get; set; }
}

View File

@@ -0,0 +1,15 @@
using Aaru.CommonTypes.Metadata;
namespace Aaru.Server.Database.Models;
public class UploadedReportDetails
{
public UploadedReport Report { get; set; }
public List<int> SameAll { get; set; }
public List<int> SameButManufacturer { get; set; }
public List<int> ReportAll { get; set; }
public List<int> ReportButManufacturer { get; set; }
public int ReadCapabilitiesId { get; set; }
public List<TestedMedia> TestedMedias { get; set; }
public List<TestedSequentialMedia> TestedSequentialMedias { get; set; }
}

View File

@@ -0,0 +1,15 @@
namespace Aaru.Server.Database.Models;
public class UsbModel
{
public string Manufacturer { get; set; }
public string Product { get; set; }
public ushort VendorID { get; set; }
public ushort ProductID { get; set; }
}
public class UsbModelForView
{
public List<UsbModel> List { get; set; }
public string Json { get; set; }
}

View File

@@ -0,0 +1,57 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : UsbProduct.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing USB product identifiers in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
using System.Text.Json.Serialization;
namespace Aaru.Server.Database.Models;
public class UsbProduct : BaseModel<int>
{
public UsbProduct() {}
public UsbProduct(UsbVendor vendor, ushort id, string product)
{
ProductId = id;
Product = product;
AddedWhen = ModifiedWhen = DateTime.UtcNow;
Vendor = vendor;
}
public ushort ProductId { get; set; }
public string Product { get; set; }
public DateTime AddedWhen { get; set; }
public DateTime ModifiedWhen { get; set; }
public int VendorId { get; set; }
[JsonIgnore]
public virtual UsbVendor Vendor { get; set; }
}

View File

@@ -0,0 +1,19 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Aaru.Server.Database.Models;
public class UsbProductModel
{
[DisplayName("Manufacturer")]
public string VendorName { get; set; }
public int VendorId { get; set; }
[DisplayName("Product")]
public string ProductName { get; set; }
[DisplayName("Product ID")]
[DisplayFormat(DataFormatString = "0x{0:X4}")]
public ushort ProductId { get; set; }
}

View File

@@ -0,0 +1,62 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : UsbVendor.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing USB vendor identifiers in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Aaru.Server.Database.Models;
public class UsbVendor : BaseModel<int>
{
public UsbVendor() {}
public UsbVendor(ushort id, string vendor)
{
VendorId = id;
Vendor = vendor;
AddedWhen = ModifiedWhen = DateTime.UtcNow;
}
[DisplayName("Manufacturer ID")]
[DisplayFormat(DataFormatString = "0x{0:X4}")]
public ushort VendorId { get; set; }
[DisplayName("Manufacturer")]
public string Vendor { get; set; }
public DateTime AddedWhen { get; set; }
public DateTime ModifiedWhen { get; set; }
[JsonIgnore]
public virtual ICollection<UsbProduct> Products { get; set; }
}

View File

@@ -0,0 +1,16 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Aaru.Server.Database.Models;
public class UsbVendorModel
{
[DisplayName("Manufacturer")]
public string Vendor { get; set; }
[DisplayName("Vendor ID")]
[DisplayFormat(DataFormatString = "0x{0:X4}")]
public ushort VendorId { get; set; }
public List<UsbProductModel> Products { get; set; }
}

View File

@@ -0,0 +1,35 @@
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Version.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru Server.
//
// --[ Description ] ----------------------------------------------------------
//
// Model for storing version statistics in database.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2024 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Server.Database.Models;
public class Version : NameCountModel<int> {}