using System; using Microsoft.EntityFrameworkCore.Migrations; namespace TOOHUCardAPI.Migrations { public partial class initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Users", columns: table => new { SteamId = table.Column(type: "TEXT", nullable: false), MaxWave = table.Column(type: "INTEGER", nullable: false), MaxTeamWave = table.Column(type: "INTEGER", nullable: false), PetLevel = table.Column(type: "INTEGER", nullable: false), EndTime = table.Column(type: "TEXT", nullable: false), KeyTotal = table.Column(type: "INTEGER", nullable: false), KeySaveDate = table.Column(type: "TEXT", nullable: false), Vip = table.Column(type: "INTEGER", nullable: false), Point = table.Column(type: "INTEGER", nullable: false), LevelList = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.SteamId); }); migrationBuilder.CreateTable( name: "EncodedCardGroup", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), EncodedString = table.Column(type: "TEXT", nullable: true), UserSteamId = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_EncodedCardGroup", x => x.Id); table.ForeignKey( name: "FK_EncodedCardGroup_Users_UserSteamId", column: x => x.UserSteamId, principalTable: "Users", principalColumn: "SteamId", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_EncodedCardGroup_UserSteamId", table: "EncodedCardGroup", column: "UserSteamId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EncodedCardGroup"); migrationBuilder.DropTable( name: "Users"); } } }