using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Knot.Modules.Auth.Migrations { /// public partial class InitialAuth : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: "identity"); migrationBuilder.CreateTable( name: "Users", schema: "identity", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Username = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), PasswordHash = table.Column(type: "text", nullable: false), DisplayName = table.Column(type: "text", nullable: false), Email = table.Column(type: "text", nullable: true), Bio = table.Column(type: "text", nullable: true), Avatar = table.Column(type: "text", nullable: true), Birthday = table.Column(type: "timestamp with time zone", nullable: true), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), HideStoryViews = table.Column(type: "boolean", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_Users_Username", schema: "identity", table: "Users", column: "Username", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Users", schema: "identity"); } } }