using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SharpbinV3.Server.Migrations { /// public partial class EmailVerificationToken : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "EmailVerified", table: "Users", type: "INTEGER", nullable: false, defaultValue: false); migrationBuilder.CreateTable( name: "EmailVerificationTokens", columns: table => new { UUID = table.Column(type: "TEXT", nullable: false), UserUUID = table.Column(type: "TEXT", nullable: false), TokenHash = table.Column(type: "TEXT", nullable: false), CreatedAt = table.Column(type: "INTEGER", nullable: false), ExpiresAt = table.Column(type: "INTEGER", nullable: false), Type = table.Column(type: "INTEGER", nullable: false), Used = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_EmailVerificationTokens", x => x.UUID); table.ForeignKey( name: "FK_EmailVerificationTokens_Users_UserUUID", column: x => x.UserUUID, principalTable: "Users", principalColumn: "UUID", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_EmailVerificationTokens_UserUUID", table: "EmailVerificationTokens", column: "UserUUID"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EmailVerificationTokens"); migrationBuilder.DropColumn( name: "EmailVerified", table: "Users"); } } }