using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace EntityFramwork.Migrations { /// public partial class test : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Images", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Base64 = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Images", x => x.Id); }); migrationBuilder.CreateTable( name: "Champions", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", nullable: false), Bio = table.Column(type: "TEXT", nullable: false), Icon = table.Column(type: "TEXT", nullable: false), ImageId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Champions", x => x.Id); table.ForeignKey( name: "FK_Champions_Images_ImageId", column: x => x.ImageId, principalTable: "Images", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Runes", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", nullable: false), Description = table.Column(type: "TEXT", nullable: false), Icon = table.Column(type: "TEXT", nullable: false), ImageId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Runes", x => x.Id); table.ForeignKey( name: "FK_Runes_Images_ImageId", column: x => x.ImageId, principalTable: "Images", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Skins", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Description = table.Column(type: "TEXT", nullable: false), Icon = table.Column(type: "TEXT", nullable: false), Price = table.Column(type: "REAL", nullable: false), ChampionForeignKey = table.Column(type: "INTEGER", nullable: false), ImageId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Skins", x => x.Id); table.ForeignKey( name: "FK_Skins_Champions_ChampionForeignKey", column: x => x.ChampionForeignKey, principalTable: "Champions", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Skins_Images_ImageId", column: x => x.ImageId, principalTable: "Images", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Champions_ImageId", table: "Champions", column: "ImageId", unique: true); migrationBuilder.CreateIndex( name: "IX_Champions_Name", table: "Champions", column: "Name", unique: true); migrationBuilder.CreateIndex( name: "IX_Runes_ImageId", table: "Runes", column: "ImageId", unique: true); migrationBuilder.CreateIndex( name: "IX_Skins_ChampionForeignKey", table: "Skins", column: "ChampionForeignKey"); migrationBuilder.CreateIndex( name: "IX_Skins_ImageId", table: "Skins", column: "ImageId", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Runes"); migrationBuilder.DropTable( name: "Skins"); migrationBuilder.DropTable( name: "Champions"); migrationBuilder.DropTable( name: "Images"); } } }