Skip to content

Commit d093d12

Browse files
committed
added missing migration
1 parent ee351b0 commit d093d12

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

.github/workflows/pull-request-develop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ jobs:
9999
env:
100100
POSTGRES_URL: localhost
101101
REDIS_URL: localhost
102-
DATABASE_URL: "postgresql://admin:password@localhost:5432/protokit?schema=public"
103102
REDIS_CI: true
103+
DATABASE_URL: "postgresql://admin:password@localhost:5432/protokit?schema=public"
104104

105105
services:
106106
postgres:
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `args` on the `Transaction` table. All the data in the column will be lost.
5+
- Added the required column `fromMessagesHash` to the `Block` table without a default value. This is not possible if the table is not empty.
6+
- Added the required column `toMessagesHash` to the `Block` table without a default value. This is not possible if the table is not empty.
7+
- Added the required column `isMessage` to the `Transaction` table without a default value. This is not possible if the table is not empty.
8+
9+
*/
10+
-- AlterTable
11+
ALTER TABLE "Batch" ADD COLUMN "settlementTransactionHash" TEXT;
12+
13+
-- AlterTable
14+
ALTER TABLE "Block" ADD COLUMN "fromMessagesHash" TEXT NOT NULL,
15+
ADD COLUMN "toMessagesHash" TEXT NOT NULL;
16+
17+
-- AlterTable
18+
ALTER TABLE "Transaction" DROP COLUMN "args",
19+
ADD COLUMN "argsFields" TEXT[],
20+
ADD COLUMN "argsJSON" TEXT[],
21+
ADD COLUMN "isMessage" BOOLEAN NOT NULL;
22+
23+
-- CreateTable
24+
CREATE TABLE "Settlement" (
25+
"transactionHash" TEXT NOT NULL,
26+
"promisedMessagesHash" TEXT NOT NULL,
27+
28+
CONSTRAINT "Settlement_pkey" PRIMARY KEY ("transactionHash")
29+
);
30+
31+
-- CreateTable
32+
CREATE TABLE "IncomingMessageBatchTransaction" (
33+
"transactionHash" TEXT NOT NULL,
34+
"batchId" INTEGER NOT NULL,
35+
36+
CONSTRAINT "IncomingMessageBatchTransaction_pkey" PRIMARY KEY ("transactionHash","batchId")
37+
);
38+
39+
-- CreateTable
40+
CREATE TABLE "IncomingMessageBatch" (
41+
"id" SERIAL NOT NULL,
42+
"fromMessageHash" TEXT NOT NULL,
43+
"toMessageHash" TEXT NOT NULL,
44+
45+
CONSTRAINT "IncomingMessageBatch_pkey" PRIMARY KEY ("id")
46+
);
47+
48+
-- AddForeignKey
49+
ALTER TABLE "Batch" ADD CONSTRAINT "Batch_settlementTransactionHash_fkey" FOREIGN KEY ("settlementTransactionHash") REFERENCES "Settlement"("transactionHash") ON DELETE SET NULL ON UPDATE CASCADE;
50+
51+
-- AddForeignKey
52+
ALTER TABLE "IncomingMessageBatchTransaction" ADD CONSTRAINT "IncomingMessageBatchTransaction_transactionHash_fkey" FOREIGN KEY ("transactionHash") REFERENCES "Transaction"("hash") ON DELETE RESTRICT ON UPDATE CASCADE;
53+
54+
-- AddForeignKey
55+
ALTER TABLE "IncomingMessageBatchTransaction" ADD CONSTRAINT "IncomingMessageBatchTransaction_batchId_fkey" FOREIGN KEY ("batchId") REFERENCES "IncomingMessageBatch"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

0 commit comments

Comments
 (0)