using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Edge.Core.Database.Migrations { public partial class ProcessorMetaConfigDbModel : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ProcessorMetaConfigs", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(nullable: false), Description = table.Column(nullable: true), Type = table.Column(nullable: false), Activated = table.Column(nullable: false), TimeStamp = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProcessorMetaConfigs", x => x.Id); }); migrationBuilder.CreateTable( name: "ProcessorPartsMetaConfigs", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), ProcessorMetaConfigId = table.Column(nullable: false), Type = table.Column(nullable: false), FullTypeString = table.Column(nullable: false), ParametersJsonArrayStr = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_ProcessorPartsMetaConfigs", x => x.Id); table.ForeignKey( name: "FK_ProcessorPartsMetaConfigs_ProcessorMetaConfigs_ProcessorMetaConfigId", column: x => x.ProcessorMetaConfigId, principalTable: "ProcessorMetaConfigs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_ProcessorMetaConfigs_Name", table: "ProcessorMetaConfigs", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_ProcessorMetaConfigs_TimeStamp", table: "ProcessorMetaConfigs", column: "TimeStamp"); migrationBuilder.CreateIndex( name: "IX_ProcessorPartsMetaConfigs_ProcessorMetaConfigId_Type", table: "ProcessorPartsMetaConfigs", columns: new[] { "ProcessorMetaConfigId", "Type" }, unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ProcessorPartsMetaConfigs"); migrationBuilder.DropTable( name: "ProcessorMetaConfigs"); } } }