using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace DorkNet.Server.Migrations { /// public partial class Phase13EventsAndObjectives : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ObjectiveProgress", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), PlayerId = table.Column(type: "INTEGER", nullable: false), Key = table.Column(type: "TEXT", maxLength: 128, nullable: false), IsCompleted = table.Column(type: "INTEGER", nullable: false), ClearedAt = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ObjectiveProgress", x => x.Id); }); migrationBuilder.CreateTable( name: "PlayerEventResponses", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), EventId = table.Column(type: "INTEGER", nullable: false), PlayerId = table.Column(type: "INTEGER", nullable: false), Response = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PlayerEventResponses", x => x.Id); }); migrationBuilder.CreateTable( name: "PlayerEvents", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), CreatorPlayerId = table.Column(type: "INTEGER", nullable: false), RoomId = table.Column(type: "INTEGER", nullable: false), Title = table.Column(type: "TEXT", maxLength: 128, nullable: false), Description = table.Column(type: "TEXT", maxLength: 2000, nullable: false), StartsAt = table.Column(type: "TEXT", nullable: false), EndsAt = table.Column(type: "TEXT", nullable: false), Capacity = table.Column(type: "INTEGER", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: false), UpdatedAt = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PlayerEvents", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_ObjectiveProgress_PlayerId_Key", table: "ObjectiveProgress", columns: new[] { "PlayerId", "Key" }, unique: true); migrationBuilder.CreateIndex( name: "IX_PlayerEventResponses_EventId_PlayerId", table: "PlayerEventResponses", columns: new[] { "EventId", "PlayerId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_PlayerEventResponses_PlayerId", table: "PlayerEventResponses", column: "PlayerId"); migrationBuilder.CreateIndex( name: "IX_PlayerEvents_CreatorPlayerId", table: "PlayerEvents", column: "CreatorPlayerId"); migrationBuilder.CreateIndex( name: "IX_PlayerEvents_StartsAt", table: "PlayerEvents", column: "StartsAt"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ObjectiveProgress"); migrationBuilder.DropTable( name: "PlayerEventResponses"); migrationBuilder.DropTable( name: "PlayerEvents"); } } }