using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace EntityFrameworkLOL.Migrations { /// public partial class MigrationWallah4 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Category", columns: table => new { Category = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Category", x => x.Category); }); migrationBuilder.CreateTable( name: "ChampionClass", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Class = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ChampionClass", x => x.Id); }); migrationBuilder.CreateTable( name: "Image", columns: table => new { Base64 = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Image", x => x.Base64); }); migrationBuilder.CreateTable( name: "RuneFamily", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Family = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RuneFamily", x => x.Id); }); migrationBuilder.CreateTable( name: "RunePage", columns: table => new { Name = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RunePage", x => x.Name); }); migrationBuilder.CreateTable( name: "SkillType", columns: table => new { Type = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SkillType", x => x.Type); }); migrationBuilder.CreateTable( name: "Champion", columns: table => new { Name = table.Column(type: "TEXT", nullable: false), Bio = table.Column(type: "TEXT", nullable: false), Icon = table.Column(type: "TEXT", nullable: false), ClassId = table.Column(type: "INTEGER", nullable: false), ImageBase64 = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Champion", x => x.Name); table.ForeignKey( name: "FK_Champion_ChampionClass_ClassId", column: x => x.ClassId, principalTable: "ChampionClass", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Champion_Image_ImageBase64", column: x => x.ImageBase64, principalTable: "Image", principalColumn: "Base64", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Rune", columns: table => new { Name = table.Column(type: "TEXT", nullable: false), Description = table.Column(type: "TEXT", nullable: false), ImageBase64 = table.Column(type: "TEXT", nullable: true), FamilyId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Rune", x => x.Name); table.ForeignKey( name: "FK_Rune_Image_ImageBase64", column: x => x.ImageBase64, principalTable: "Image", principalColumn: "Base64"); table.ForeignKey( name: "FK_Rune_RuneFamily_FamilyId", column: x => x.FamilyId, principalTable: "RuneFamily", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Skin", columns: table => new { Name = table.Column(type: "TEXT", nullable: false), Description = table.Column(type: "TEXT", nullable: false), Icon = table.Column(type: "TEXT", nullable: false), Price = table.Column(type: "REAL", nullable: false), ImageBase64 = table.Column(type: "TEXT", nullable: true), ChampionSkinName = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Skin", x => x.Name); table.ForeignKey( name: "FK_Skin_Champion_ChampionSkinName", column: x => x.ChampionSkinName, principalTable: "Champion", principalColumn: "Name"); table.ForeignKey( name: "FK_Skin_Image_ImageBase64", column: x => x.ImageBase64, principalTable: "Image", principalColumn: "Base64"); }); migrationBuilder.CreateIndex( name: "IX_Champion_ClassId", table: "Champion", column: "ClassId"); migrationBuilder.CreateIndex( name: "IX_Champion_ImageBase64", table: "Champion", column: "ImageBase64"); migrationBuilder.CreateIndex( name: "IX_Rune_FamilyId", table: "Rune", column: "FamilyId"); migrationBuilder.CreateIndex( name: "IX_Rune_ImageBase64", table: "Rune", column: "ImageBase64"); migrationBuilder.CreateIndex( name: "IX_Skin_ChampionSkinName", table: "Skin", column: "ChampionSkinName"); migrationBuilder.CreateIndex( name: "IX_Skin_ImageBase64", table: "Skin", column: "ImageBase64"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Category"); migrationBuilder.DropTable( name: "Rune"); migrationBuilder.DropTable( name: "RunePage"); migrationBuilder.DropTable( name: "SkillType"); migrationBuilder.DropTable( name: "Skin"); migrationBuilder.DropTable( name: "RuneFamily"); migrationBuilder.DropTable( name: "Champion"); migrationBuilder.DropTable( name: "ChampionClass"); migrationBuilder.DropTable( name: "Image"); } } }