using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SchotzIadKmTracker.Api.Data.Migrations { /// public partial class AjoutAuthentification : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Comptes", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false), Email = table.Column(type: "TEXT", maxLength: 255, nullable: false), MotDePasseHash = table.Column(type: "TEXT", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: false), UpdatedAt = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Comptes", x => x.Id); }); migrationBuilder.CreateTable( name: "ResetPasswordTokens", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), TokenHash = table.Column(type: "TEXT", nullable: false), Expiration = table.Column(type: "TEXT", nullable: false), UsedAt = table.Column(type: "TEXT", nullable: true), CreatedAt = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ResetPasswordTokens", x => x.Id); }); migrationBuilder.CreateIndex( name: "UX_Comptes_Email", table: "Comptes", column: "Email", unique: true); migrationBuilder.CreateIndex( name: "IX_ResetTokens_Expiration", table: "ResetPasswordTokens", column: "Expiration"); migrationBuilder.CreateIndex( name: "UX_ResetTokens_TokenHash", table: "ResetPasswordTokens", column: "TokenHash", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Comptes"); migrationBuilder.DropTable( name: "ResetPasswordTokens"); } } }