Foxnouns.NET/Foxnouns.Backend/Database/Migrations/20240712233806_AddUserLastActive.cs

32 lines
945 B
C#

using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace Foxnouns.Backend.Database.Migrations
{
/// <inheritdoc />
[DbContext(typeof(DatabaseContext))]
[Migration("20240712233806_AddUserLastActive")]
public partial class AddUserLastActive : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Instant>(
name: "last_active",
table: "users",
type: "timestamp with time zone",
nullable: false,
defaultValueSql: "now()"
);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(name: "last_active", table: "users");
}
}
}