/****************************************************************************** // MARECHAI: Master repository of computing history artifacts information // ---------------------------------------------------------------------------- // // Author(s) : Natalia Portillo // // --[ 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 . // // ---------------------------------------------------------------------------- // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Marechai.Database.Migrations { public partial class AddMedia : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable("Media", table => new { Id = table.Column(nullable: false). Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), CreatedOn = table.Column(nullable: false). Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), UpdatedOn = table.Column(nullable: false). Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn), Title = table.Column(nullable: true), Sequence = table.Column(nullable: true), LastSequence = table.Column(nullable: true), Type = table.Column(nullable: false), WriteOffset = table.Column(nullable: true), Sides = table.Column(nullable: true), Layers = table.Column(nullable: true), Sessions = table.Column(nullable: true), Tracks = table.Column(nullable: true), Sectors = table.Column(nullable: false), Size = table.Column(nullable: false), CopyProtection = table.Column(nullable: true), PartNumber = table.Column(nullable: true), SerialNumber = table.Column(nullable: true), Barcode = table.Column(nullable: true), CatalogueNumber = table.Column(nullable: true), Manufacturer = table.Column(nullable: true), Model = table.Column(nullable: true), Revision = table.Column(nullable: true), Firmware = table.Column(nullable: true), PhysicalBlockSize = table.Column(nullable: true), LogicalBlockSize = table.Column(nullable: true), BlockSizes = table.Column(nullable: true), StorageInterface = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Media", x => x.Id); }); migrationBuilder.CreateIndex("IX_Media_Barcode", "Media", "Barcode"); migrationBuilder.CreateIndex("IX_Media_CatalogueNumber", "Media", "CatalogueNumber"); migrationBuilder.CreateIndex("IX_Media_CopyProtection", "Media", "CopyProtection"); migrationBuilder.CreateIndex("IX_Media_Firmware", "Media", "Firmware"); migrationBuilder.CreateIndex("IX_Media_Manufacturer", "Media", "Manufacturer"); migrationBuilder.CreateIndex("IX_Media_Model", "Media", "Model"); migrationBuilder.CreateIndex("IX_Media_PartNumber", "Media", "PartNumber"); migrationBuilder.CreateIndex("IX_Media_Revision", "Media", "Revision"); migrationBuilder.CreateIndex("IX_Media_SerialNumber", "Media", "SerialNumber"); migrationBuilder.CreateIndex("IX_Media_Title", "Media", "Title"); migrationBuilder.CreateIndex("IX_Media_Type", "Media", "Type"); } protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.DropTable("Media"); } }