using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace VoidCat.Migrations { /// public partial class Paywall : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Payment", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Service = table.Column(type: "integer", nullable: false), Currency = table.Column(type: "smallint", nullable: false), Amount = table.Column(type: "numeric", nullable: false), Required = table.Column(type: "boolean", nullable: false, defaultValue: true) }, constraints: table => { table.PrimaryKey("PK_Payment", x => x.Id); table.ForeignKey( name: "FK_Payment_Files_Id", column: x => x.Id, principalTable: "Files", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "PaymentOrder", columns: table => new { Id = table.Column(type: "uuid", nullable: false), FileId = table.Column(type: "uuid", nullable: false), Service = table.Column(type: "integer", nullable: false), Currency = table.Column(type: "smallint", nullable: false), Amount = table.Column(type: "numeric", nullable: false), Status = table.Column(type: "smallint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PaymentOrder", x => x.Id); table.ForeignKey( name: "FK_PaymentOrder_Files_FileId", column: x => x.FileId, principalTable: "Files", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "PaymentStrike", columns: table => new { Id = table.Column(type: "uuid", nullable: false), Handle = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PaymentStrike", x => x.Id); table.ForeignKey( name: "FK_PaymentStrike_Payment_Id", column: x => x.Id, principalTable: "Payment", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "PaymentOrderLightning", columns: table => new { OrderId = table.Column(type: "uuid", nullable: false), Invoice = table.Column(type: "text", nullable: false), Expire = table.Column(type: "timestamp with time zone", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PaymentOrderLightning", x => x.OrderId); table.ForeignKey( name: "FK_PaymentOrderLightning_PaymentOrder_OrderId", column: x => x.OrderId, principalTable: "PaymentOrder", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_PaymentOrder_FileId", table: "PaymentOrder", column: "FileId"); migrationBuilder.CreateIndex( name: "IX_PaymentOrder_Status", table: "PaymentOrder", column: "Status"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PaymentOrderLightning"); migrationBuilder.DropTable( name: "PaymentStrike"); migrationBuilder.DropTable( name: "PaymentOrder"); migrationBuilder.DropTable( name: "Payment"); } } }