mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
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
This commit is contained in:
2143
util/PostgresMigrations/Migrations/20230201192558_LastUserDates.Designer.cs
generated
Normal file
2143
util/PostgresMigrations/Migrations/20230201192558_LastUserDates.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,54 @@
|
||||
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");
|
||||
}
|
||||
}
|
@ -1230,9 +1230,21 @@ namespace Bit.PostgresMigrations.Migrations
|
||||
b.Property<string>("Key")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime?>("LastEmailChangeDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("LastFailedLoginDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("LastKdfChangeDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("LastKeyRotationDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("LastPasswordChangeDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("LicenseKey")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)");
|
||||
|
Reference in New Issue
Block a user