using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Yavsc.Migrations { /// public partial class PerformerPayPalDonations : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "DonationPayPalEmail", table: "Performers", type: "character varying(127)", maxLength: 127, nullable: true); migrationBuilder.CreateTable( name: "PerformerDonations", columns: table => new { Id = table.Column(type: "uuid", nullable: false), DonorId = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), PerformerId = table.Column(type: "character varying(450)", maxLength: 450, nullable: false), RecipientEmail = table.Column(type: "character varying(127)", maxLength: 127, nullable: false), Amount = table.Column(type: "numeric(18,2)", nullable: false), Currency = table.Column(type: "character varying(3)", maxLength: 3, nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), State = table.Column(type: "integer", nullable: false), CheckoutToken = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), TransactionId = table.Column(type: "character varying(32)", maxLength: 32, nullable: true), CompletedAt = table.Column(type: "timestamp with time zone", nullable: true), Revision = table.Column(type: "uuid", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PerformerDonations", x => x.Id); table.ForeignKey( name: "FK_PerformerDonations_AspNetUsers_DonorId", column: x => x.DonorId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_PerformerDonations_Performers_PerformerId", column: x => x.PerformerId, principalTable: "Performers", principalColumn: "PerformerId", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_PerformerDonations_CheckoutToken", table: "PerformerDonations", column: "CheckoutToken", unique: true); migrationBuilder.CreateIndex( name: "IX_PerformerDonations_DonorId", table: "PerformerDonations", column: "DonorId"); migrationBuilder.CreateIndex( name: "IX_PerformerDonations_PerformerId", table: "PerformerDonations", column: "PerformerId"); migrationBuilder.CreateIndex( name: "IX_PerformerDonations_TransactionId", table: "PerformerDonations", column: "TransactionId", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PerformerDonations"); migrationBuilder.DropColumn( name: "DonationPayPalEmail", table: "Performers"); } } }