64 lines
2.0 KiB
C#
64 lines
2.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace gehGassi.Persistence.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AppUserPrivacyAdded : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "PaymentTermsAccepted",
|
|
table: "AppUsers",
|
|
type: "bit",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddColumn<DateTimeOffset>(
|
|
name: "PaymentTermsAcceptedDate",
|
|
table: "AppUsers",
|
|
type: "datetimeoffset",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "PrivacyAccepted",
|
|
table: "AppUsers",
|
|
type: "bit",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddColumn<DateTimeOffset>(
|
|
name: "PrivacyAcceptedDate",
|
|
table: "AppUsers",
|
|
type: "datetimeoffset",
|
|
nullable: true);
|
|
|
|
migrationBuilder.Sql("UPDATE AppUsers SET PrivacyAccepted = TermsAccepted, PrivacyAcceptedDate = TermsAcceptedDate, PaymentTermsAccepted = 0, PaymentTermsAcceptedDate = NULL");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "PaymentTermsAccepted",
|
|
table: "AppUsers");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "PaymentTermsAcceptedDate",
|
|
table: "AppUsers");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "PrivacyAccepted",
|
|
table: "AppUsers");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "PrivacyAcceptedDate",
|
|
table: "AppUsers");
|
|
}
|
|
}
|
|
}
|