40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace gehGassi.Persistence.Migrations
|
|
{
|
|
public partial class AppUserTermsAdded : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "TermsAccepted",
|
|
table: "AppUsers",
|
|
type: "bit",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddColumn<DateTimeOffset>(
|
|
name: "TermsAcceptedDate",
|
|
table: "AppUsers",
|
|
type: "datetimeoffset",
|
|
nullable: true);
|
|
|
|
migrationBuilder.Sql("UPDATE AppUsers SET TermsAccepted = 1, TermsAcceptedDate = Created");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "TermsAccepted",
|
|
table: "AppUsers");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TermsAcceptedDate",
|
|
table: "AppUsers");
|
|
}
|
|
}
|
|
}
|