using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace EFlib.Migrations { /// public partial class myMigrations : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "EFLargeImage", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Base64 = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_EFLargeImage", x => x.Id); }); migrationBuilder.CreateTable( name: "Champions", columns: table => new { Name = table.Column(type: "TEXT", maxLength: 256, nullable: false), Bio = table.Column(type: "TEXT", maxLength: 500, nullable: false), Icon = table.Column(type: "TEXT", nullable: false), Class = table.Column(type: "INTEGER", nullable: false), ImageId = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Champions", x => x.Name); table.ForeignKey( name: "FK_Champions_EFLargeImage_ImageId", column: x => x.ImageId, principalTable: "EFLargeImage", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "EFCharacteristics", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", nullable: false), Value = table.Column(type: "INTEGER", nullable: false), EFChampionName = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_EFCharacteristics", x => x.Id); table.ForeignKey( name: "FK_EFCharacteristics_Champions_EFChampionName", column: x => x.EFChampionName, principalTable: "Champions", principalColumn: "Name", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Skills", columns: table => new { Name = table.Column(type: "TEXT", nullable: false), Description = table.Column(type: "TEXT", nullable: false), Type = table.Column(type: "INTEGER", nullable: false), EFChampionName = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Skills", x => x.Name); table.ForeignKey( name: "FK_Skills_Champions_EFChampionName", column: x => x.EFChampionName, principalTable: "Champions", principalColumn: "Name"); }); migrationBuilder.CreateTable( name: "Skins", 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), ImageId = table.Column(type: "TEXT", nullable: false), NameChampion = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Skins", x => x.Name); table.ForeignKey( name: "FK_Skins_Champions_NameChampion", column: x => x.NameChampion, principalTable: "Champions", principalColumn: "Name", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Skins_EFLargeImage_ImageId", column: x => x.ImageId, principalTable: "EFLargeImage", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Champions_ImageId", table: "Champions", column: "ImageId"); migrationBuilder.CreateIndex( name: "IX_EFCharacteristics_EFChampionName", table: "EFCharacteristics", column: "EFChampionName"); migrationBuilder.CreateIndex( name: "IX_Skills_EFChampionName", table: "Skills", column: "EFChampionName"); migrationBuilder.CreateIndex( name: "IX_Skins_ImageId", table: "Skins", column: "ImageId"); migrationBuilder.CreateIndex( name: "IX_Skins_NameChampion", table: "Skins", column: "NameChampion"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EFCharacteristics"); migrationBuilder.DropTable( name: "Skills"); migrationBuilder.DropTable( name: "Skins"); migrationBuilder.DropTable( name: "Champions"); migrationBuilder.DropTable( name: "EFLargeImage"); } } }