Add filesystems.

This commit is contained in:
2020-06-11 00:24:38 +01:00
parent d3dee1c841
commit d8c6591da2
6 changed files with 4844 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,91 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Marechai.Database.Migrations
{
public partial class AddFilesystems : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable("Filesystems", table => new
{
Id = table.Column<ulong>(nullable: false).
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedOn = table.Column<DateTime>(nullable: false).
Annotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn),
UpdatedOn = table.Column<DateTime>(nullable: false).
Annotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.ComputedColumn),
Type = table.Column<string>(nullable: false), CreationDate = table.Column<DateTime>(nullable: true),
ModificationDate = table.Column<DateTime>(nullable: true),
BackupDate = table.Column<DateTime>(nullable: true), ClusterSize = table.Column<int>(nullable: false),
Clusters = table.Column<ulong>(nullable: false), Files = table.Column<ulong>(nullable: true),
Bootable = table.Column<bool>(nullable: false), Serial = table.Column<string>(nullable: true),
Label = table.Column<string>(nullable: true), FreeClusters = table.Column<ulong>(nullable: true),
ExpirationDate = table.Column<DateTime>(nullable: true),
EffectiveDate = table.Column<DateTime>(nullable: true),
SystemIdentifier = table.Column<string>(nullable: true),
VolumeSetIdentifier = table.Column<string>(nullable: true),
PublisherIdentifier = table.Column<string>(nullable: true),
DataPreparerIdentifier = table.Column<string>(nullable: true),
ApplicationIdentifier = table.Column<string>(nullable: true)
}, constraints: table =>
{
table.PrimaryKey("PK_Filesystems", x => x.Id);
});
migrationBuilder.CreateIndex("IX_Filesystems_ApplicationIdentifier", "Filesystems",
"ApplicationIdentifier");
migrationBuilder.CreateIndex("IX_Filesystems_BackupDate", "Filesystems", "BackupDate");
migrationBuilder.CreateIndex("IX_Filesystems_CreationDate", "Filesystems", "CreationDate");
migrationBuilder.CreateIndex("IX_Filesystems_DataPreparerIdentifier", "Filesystems",
"DataPreparerIdentifier");
migrationBuilder.CreateIndex("IX_Filesystems_Label", "Filesystems", "Label");
migrationBuilder.CreateIndex("IX_Filesystems_ModificationDate", "Filesystems", "ModificationDate");
migrationBuilder.CreateIndex("IX_Filesystems_PublisherIdentifier", "Filesystems", "PublisherIdentifier");
migrationBuilder.CreateIndex("IX_Filesystems_Serial", "Filesystems", "Serial");
migrationBuilder.CreateIndex("IX_Filesystems_SystemIdentifier", "Filesystems", "SystemIdentifier");
migrationBuilder.CreateIndex("IX_Filesystems_Type", "Filesystems", "Type");
migrationBuilder.CreateIndex("IX_Filesystems_VolumeSetIdentifier", "Filesystems", "VolumeSetIdentifier");
}
protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("Filesystems");
}
}

View File

@@ -815,6 +815,77 @@ namespace Marechai.Database.Migrations
b.ToTable("FileDataStreams");
});
modelBuilder.Entity("Marechai.Database.Models.Filesystem", b =>
{
b.Property<ulong>("Id").ValueGeneratedOnAdd().HasColumnType("bigint unsigned");
b.Property<string>("ApplicationIdentifier").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<DateTime?>("BackupDate").HasColumnType("datetime(6)");
b.Property<bool>("Bootable").HasColumnType("bit(1)");
b.Property<int>("ClusterSize").HasColumnType("int");
b.Property<ulong>("Clusters").HasColumnType("bigint unsigned");
b.Property<DateTime>("CreatedOn").ValueGeneratedOnAdd().HasColumnType("datetime(6)");
b.Property<DateTime?>("CreationDate").HasColumnType("datetime(6)");
b.Property<string>("DataPreparerIdentifier").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<DateTime?>("EffectiveDate").HasColumnType("datetime(6)");
b.Property<DateTime?>("ExpirationDate").HasColumnType("datetime(6)");
b.Property<ulong?>("Files").HasColumnType("bigint unsigned");
b.Property<ulong?>("FreeClusters").HasColumnType("bigint unsigned");
b.Property<string>("Label").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<DateTime?>("ModificationDate").HasColumnType("datetime(6)");
b.Property<string>("PublisherIdentifier").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<string>("Serial").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<string>("SystemIdentifier").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<string>("Type").IsRequired().HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.Property<DateTime>("UpdatedOn").ValueGeneratedOnAddOrUpdate().HasColumnType("datetime(6)");
b.Property<string>("VolumeSetIdentifier").HasColumnType("varchar(255) CHARACTER SET utf8mb4");
b.HasKey("Id");
b.HasIndex("ApplicationIdentifier");
b.HasIndex("BackupDate");
b.HasIndex("CreationDate");
b.HasIndex("DataPreparerIdentifier");
b.HasIndex("Label");
b.HasIndex("ModificationDate");
b.HasIndex("PublisherIdentifier");
b.HasIndex("Serial");
b.HasIndex("SystemIdentifier");
b.HasIndex("Type");
b.HasIndex("VolumeSetIdentifier");
b.ToTable("Filesystems");
});
modelBuilder.Entity("Marechai.Database.Models.Forbidden", b =>
{
b.Property<int>("Id").ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("int(11)");

View File

@@ -0,0 +1,53 @@
/******************************************************************************
// 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 Filesystem : BaseModel<ulong>
{
[Required]
public string Type { get; set; }
public DateTime? CreationDate { get; set; }
public DateTime? ModificationDate { get; set; }
public DateTime? BackupDate { get; set; }
public int ClusterSize { get; set; }
public ulong Clusters { get; set; }
public ulong? Files { get; set; }
public bool Bootable { get; set; }
public string Serial { get; set; }
public string Label { get; set; }
public ulong? FreeClusters { get; set; }
public DateTime? ExpirationDate { get; set; }
public DateTime? EffectiveDate { get; set; }
public string SystemIdentifier { get; set; }
public string VolumeSetIdentifier { get; set; }
public string PublisherIdentifier { get; set; }
public string DataPreparerIdentifier { get; set; }
public string ApplicationIdentifier { get; set; }
}
}

View File

@@ -108,6 +108,7 @@ namespace Marechai.Database.Models
public virtual DbSet<DumpHardware> DumpHardwares { get; set; }
public virtual DbSet<DbFile> Files { get; set; }
public virtual DbSet<FileDataStream> FileDataStreams { get; set; }
public virtual DbSet<Filesystem> Filesystems { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
@@ -1621,6 +1622,21 @@ namespace Marechai.Database.Models
entity.HasIndex(d => d.Name);
entity.HasIndex(d => d.Size);
});
modelBuilder.Entity<Filesystem>(entity =>
{
entity.HasIndex(d => d.Type);
entity.HasIndex(d => d.CreationDate);
entity.HasIndex(d => d.ModificationDate);
entity.HasIndex(d => d.BackupDate);
entity.HasIndex(d => d.Serial);
entity.HasIndex(d => d.Label);
entity.HasIndex(d => d.SystemIdentifier);
entity.HasIndex(d => d.VolumeSetIdentifier);
entity.HasIndex(d => d.PublisherIdentifier);
entity.HasIndex(d => d.DataPreparerIdentifier);
entity.HasIndex(d => d.ApplicationIdentifier);
});
}
}
}

View File

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