67 lines
2.1 KiB
C#
67 lines
2.1 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace gehGassiApp.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AppUserPrivacyAdded : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "PaymentTermsAccepted",
|
|
table: "AppUsers",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "PaymentTermsAcceptedDate",
|
|
table: "AppUsers",
|
|
type: "INTEGER",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "PrivacyAccepted",
|
|
table: "AppUsers",
|
|
type: "INTEGER",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "PrivacyAcceptedDate",
|
|
table: "AppUsers",
|
|
type: "INTEGER",
|
|
nullable: true);
|
|
|
|
System.Diagnostics.Debug.WriteLine($"Migration AppUserPrivacyAdded done");
|
|
|
|
migrationBuilder.Sql("UPDATE AppUsers SET PrivacyAccepted = TermsAccepted, PrivacyAcceptedDate = TermsAcceptedDate, PaymentTermsAccepted = 0, PaymentTermsAcceptedDate = NULL");
|
|
|
|
System.Diagnostics.Debug.WriteLine($"Migration AppUserPrivacyAdded Updated");
|
|
}
|
|
|
|
/// <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");
|
|
}
|
|
}
|
|
}
|