stacker.news/prisma/migrations/20210507005624_invoices/migration.sql

26 lines
715 B
MySQL
Raw Normal View History

2021-05-11 15:52:50 +00:00
-- DropIndex
DROP INDEX "item_gist_path_index";
-- CreateTable
CREATE TABLE "Invoice" (
"id" SERIAL NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"userId" INTEGER NOT NULL,
"hash" TEXT NOT NULL,
"bolt11" TEXT NOT NULL,
"expiresAt" TIMESTAMP(3) NOT NULL,
"confirmedAt" TIMESTAMP(3),
"requested" INTEGER NOT NULL,
"received" INTEGER,
"cancelled" BOOLEAN NOT NULL DEFAULT false,
PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "Invoice.userId_index" ON "Invoice"("userId");
-- AddForeignKey
ALTER TABLE "Invoice" ADD FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;