Add dump hardwares.

This commit is contained in:
2020-06-10 21:59:48 +01:00
parent d1831c5aa0
commit d43c149f4e
6 changed files with 7603 additions and 1576 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,58 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Marechai.Database.Migrations
{
public partial class AddDumpHardware : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable("DumpHardwares", table => new
{
Id = table.Column<ulong>(nullable: false).
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedOn = table.Column<DateTime>(nullable: false).
Annotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn),
UpdatedOn = table.Column<DateTime>(nullable: false).
Annotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.ComputedColumn),
Manufacturer = table.Column<string>(maxLength: 48, nullable: true),
Model = table.Column<string>(maxLength: 48, nullable: false),
Revision = table.Column<string>(maxLength: 48, nullable: true),
Firmware = table.Column<string>(maxLength: 32, nullable: true),
Serial = table.Column<string>(maxLength: 64, nullable: true),
SoftwareName = table.Column<string>(maxLength: 64, nullable: false),
SoftwareVersion = table.Column<string>(maxLength: 32, nullable: true),
SoftwareOperatingSystem = table.Column<string>(maxLength: 64, nullable: true),
Extents = table.Column<string>(nullable: false)
}, constraints: table =>
{
table.PrimaryKey("PK_DumpHardwares", x => x.Id);
});
migrationBuilder.CreateIndex("IX_DumpHardwares_Firmware", "DumpHardwares", "Firmware");
migrationBuilder.CreateIndex("IX_DumpHardwares_Manufacturer", "DumpHardwares", "Manufacturer");
migrationBuilder.CreateIndex("IX_DumpHardwares_Model", "DumpHardwares", "Model");
migrationBuilder.CreateIndex("IX_DumpHardwares_Revision", "DumpHardwares", "Revision");
migrationBuilder.CreateIndex("IX_DumpHardwares_Serial", "DumpHardwares", "Serial");
migrationBuilder.CreateIndex("IX_DumpHardwares_SoftwareName", "DumpHardwares", "SoftwareName");
migrationBuilder.CreateIndex("IX_DumpHardwares_SoftwareOperatingSystem", "DumpHardwares",
"SoftwareOperatingSystem");
migrationBuilder.CreateIndex("IX_DumpHardwares_SoftwareVersion", "DumpHardwares", "SoftwareVersion");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable("DumpHardwares");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
using System;
using System.ComponentModel.DataAnnotations;
namespace Marechai.Database.Models
{
public class DumpHardware : BaseModel<ulong>
{
[StringLength(48)]
public string Manufacturer { get; set; }
[StringLength(48), Required]
public string Model { get; set; }
[StringLength(48)]
public string Revision { get; set; }
[StringLength(32)]
public string Firmware { get; set; }
[StringLength(64)]
public string Serial { get; set; }
[StringLength(64), Required]
public string SoftwareName { get; set; }
[StringLength(32)]
public string SoftwareVersion { get; set; }
[StringLength(64)]
public string SoftwareOperatingSystem { get; set; }
[Required]
public JsonObject<Extent[]> Extents { get; set; }
}
}

View File

@@ -99,6 +99,7 @@ namespace Marechai.Database.Models
public virtual DbSet<Iso4217> Iso4217 { get; set; }
public virtual DbSet<CurrencyInflation> CurrenciesInflation { get; set; }
public virtual DbSet<CurrencyPegging> CurrenciesPegging { get; set; }
public virtual DbSet<DumpHardware> DumpHardwares { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
@@ -1572,6 +1573,18 @@ namespace Marechai.Database.Models
entity.HasIndex(d => d.Start);
entity.HasIndex(d => d.End);
});
modelBuilder.Entity<DumpHardware>(entity =>
{
entity.HasIndex(e => e.Manufacturer);
entity.HasIndex(e => e.Model);
entity.HasIndex(e => e.Revision);
entity.HasIndex(e => e.Firmware);
entity.HasIndex(e => e.Serial);
entity.HasIndex(e => e.SoftwareName);
entity.HasIndex(e => e.SoftwareVersion);
entity.HasIndex(e => e.SoftwareOperatingSystem);
});
}
}
}

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>4.0.0.1654</Version>
<Version>4.0.0.1662</Version>
<Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product>