using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace gehGassiApp.Data.Migrations
{
///
public partial class AppUserPrivacyAdded : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "PaymentTermsAccepted",
table: "AppUsers",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "PaymentTermsAcceptedDate",
table: "AppUsers",
type: "INTEGER",
nullable: true);
migrationBuilder.AddColumn(
name: "PrivacyAccepted",
table: "AppUsers",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
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");
}
///
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");
}
}
}