39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace LANCommander.Migrations
|
|
{
|
|
public partial class AddUserApproval : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "Approved",
|
|
table: "AspNetUsers",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "ApprovedOn",
|
|
table: "AspNetUsers",
|
|
type: "TEXT",
|
|
nullable: true);
|
|
|
|
migrationBuilder.Sql("update AspNetUsers set Approved = 1, ApprovedOn = datetime('now')");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Approved",
|
|
table: "AspNetUsers");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ApprovedOn",
|
|
table: "AspNetUsers");
|
|
}
|
|
}
|
|
}
|