using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace HyperBooru.Migrations { /// public partial class Users : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Users", columns: table => new { ObjectId = table.Column(type: "integer", nullable: false), Username = table.Column(type: "text", nullable: false), PasswordHash = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.ObjectId); table.ForeignKey( name: "FK_Users_Objects_ObjectId", column: x => x.ObjectId, principalTable: "Objects", principalColumn: "ObjectId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.InsertData( table: "Objects", columns: new[] { "ObjectId", "Guid" }, values: new object[] { -3, new Guid("4fa948f4-7c45-4f81-bb6b-e417491e6c96") }); migrationBuilder.InsertData( table: "Users", columns: new[] { "ObjectId", "PasswordHash", "Username" }, values: new object[] { -3, "P4geAuE2yX/PDRHuJSq74FF5vO782rWz5c0LAQPR8m45DEYAONhu1wYnAn60PSNyjocqEBdnCeKCJfK3sKyuWw==", "admin" }); migrationBuilder.CreateIndex( name: "IX_Users_Username", table: "Users", column: "Username"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Users"); migrationBuilder.DeleteData( table: "Objects", keyColumn: "ObjectId", keyValue: -3); } } }