using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SVSim.Database.Migrations { /// public partial class Initial : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ShadowverseDeckEntry", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), DateCreated = table.Column(type: "TEXT", nullable: true), DateUpdated = table.Column(type: "TEXT", nullable: true), InternalName = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ShadowverseDeckEntry", x => x.Id); }); migrationBuilder.CreateTable( name: "Viewer", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), DisplayName = table.Column(type: "TEXT", nullable: false), ShortUdid = table.Column(type: "INTEGER", nullable: false), DateCreated = table.Column(type: "TEXT", nullable: true), DateUpdated = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Viewer", x => x.Id); }); migrationBuilder.CreateTable( name: "CardEntry", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false), InternalName = table.Column(type: "TEXT", nullable: false), Attack = table.Column(type: "INTEGER", nullable: true), Defense = table.Column(type: "INTEGER", nullable: true), PrimaryResourceCost = table.Column(type: "INTEGER", nullable: true), Discriminator = table.Column(type: "TEXT", maxLength: 21, nullable: false), ShadowverseDeckEntryId = table.Column(type: "INTEGER", nullable: true), DateCreated = table.Column(type: "TEXT", nullable: true), DateUpdated = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_CardEntry", x => x.Id); table.ForeignKey( name: "FK_CardEntry_ShadowverseDeckEntry_ShadowverseDeckEntryId", column: x => x.ShadowverseDeckEntryId, principalTable: "ShadowverseDeckEntry", principalColumn: "Id"); }); migrationBuilder.CreateTable( name: "SocialAccountConnection", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), AccountType = table.Column(type: "INTEGER", nullable: false), AccountId = table.Column(type: "INTEGER", nullable: false), ViewerId = table.Column(type: "INTEGER", nullable: false), DateCreated = table.Column(type: "TEXT", nullable: true), DateUpdated = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_SocialAccountConnection", x => x.Id); table.ForeignKey( name: "FK_SocialAccountConnection_Viewer_ViewerId", column: x => x.ViewerId, principalTable: "Viewer", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_CardEntry_ShadowverseDeckEntryId", table: "CardEntry", column: "ShadowverseDeckEntryId"); migrationBuilder.CreateIndex( name: "IX_SocialAccountConnection_ViewerId", table: "SocialAccountConnection", column: "ViewerId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "CardEntry"); migrationBuilder.DropTable( name: "SocialAccountConnection"); migrationBuilder.DropTable( name: "ShadowverseDeckEntry"); migrationBuilder.DropTable( name: "Viewer"); } } }