using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace gehGassi.Persistence.Migrations { /// public partial class AppUserPrivacyAdded : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "PaymentTermsAccepted", table: "AppUsers", type: "bit", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "PaymentTermsAcceptedDate", table: "AppUsers", type: "datetimeoffset", nullable: true); migrationBuilder.AddColumn( name: "PrivacyAccepted", table: "AppUsers", type: "bit", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "PrivacyAcceptedDate", table: "AppUsers", type: "datetimeoffset", nullable: true); migrationBuilder.Sql("UPDATE AppUsers SET PrivacyAccepted = TermsAccepted, PrivacyAcceptedDate = TermsAcceptedDate, PaymentTermsAccepted = 0, PaymentTermsAcceptedDate = NULL"); } /// 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"); } } }