using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace NostrStreamer.Migrations { /// public partial class PaymentSetup : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_Payments", table: "Payments"); migrationBuilder.AddColumn( name: "xmin", table: "Users", type: "xid", rowVersion: true, nullable: false, defaultValue: 0u); migrationBuilder.AddColumn( name: "PaymentHash", table: "Payments", type: "text", nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "Amount", table: "Payments", type: "numeric(20,0)", nullable: false, defaultValue: 0m); migrationBuilder.AddColumn( name: "Created", table: "Payments", type: "timestamp with time zone", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); migrationBuilder.AddPrimaryKey( name: "PK_Payments", table: "Payments", column: "PaymentHash"); migrationBuilder.CreateIndex( name: "IX_Payments_PubKey", table: "Payments", column: "PubKey"); migrationBuilder.AddForeignKey( name: "FK_Payments_Users_PubKey", table: "Payments", column: "PubKey", principalTable: "Users", principalColumn: "PubKey", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Payments_Users_PubKey", table: "Payments"); migrationBuilder.DropPrimaryKey( name: "PK_Payments", table: "Payments"); migrationBuilder.DropIndex( name: "IX_Payments_PubKey", table: "Payments"); migrationBuilder.DropColumn( name: "xmin", table: "Users"); migrationBuilder.DropColumn( name: "PaymentHash", table: "Payments"); migrationBuilder.DropColumn( name: "Amount", table: "Payments"); migrationBuilder.DropColumn( name: "Created", table: "Payments"); migrationBuilder.AddPrimaryKey( name: "PK_Payments", table: "Payments", column: "PubKey"); } } }