|
| 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