1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-01 13:43:23 +01:00
bitwarden-server/util/PostgresMigrations/Migrations/20230201192558_LastUserDates.cs
Kyle Spearrin 7e74695afc
add timestamps to user table for security related events (#2660)
* add timestamps to user table for security related events

* ef migrations

* fix lint problems

* formatting

* add missing namespace back

* move `now` up some

* review fixes

* add missing view rebuild to migration script
2023-02-02 14:39:57 -05:00

55 lines
1.5 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
public partial class LastUserDates : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "LastEmailChangeDate",
table: "User",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "LastKdfChangeDate",
table: "User",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "LastKeyRotationDate",
table: "User",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "LastPasswordChangeDate",
table: "User",
type: "timestamp with time zone",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "LastEmailChangeDate",
table: "User");
migrationBuilder.DropColumn(
name: "LastKdfChangeDate",
table: "User");
migrationBuilder.DropColumn(
name: "LastKeyRotationDate",
table: "User");
migrationBuilder.DropColumn(
name: "LastPasswordChangeDate",
table: "User");
}
}