-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pending transactions * ci: version bump to 0.86.1-rc-pending-txs.0 * Improve schema * ci: version bump to 0.86.1-rc-pending-txs.1 * Always include destination chain id * ci: version bump to 0.86.1-rc-pending-txs.2 --------- Co-authored-by: Automated Version Bump <[email protected]>
- Loading branch information
Showing
3 changed files
with
105 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/prisma/migrations/20240928234126_pending_txs/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-- CreateEnum | ||
CREATE TYPE "TransactionStatus" AS ENUM ('pending', 'completed', 'failed'); | ||
|
||
-- CreateTable | ||
CREATE TABLE "PendingNftTransaction" ( | ||
"id" UUID NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"userId" UUID NOT NULL, | ||
"sourceChainTxHash" TEXT NOT NULL, | ||
"sourceChainId" INTEGER NOT NULL, | ||
"targetAmountReceived" BIGINT NOT NULL, | ||
"targetCurrencyContractAddress" TEXT NOT NULL, | ||
"destinationChainId" INTEGER NOT NULL, | ||
"destinationChainTxHash" TEXT, | ||
"contractAddress" TEXT NOT NULL, | ||
"tokenId" BIGINT NOT NULL, | ||
"tokenAmount" INTEGER NOT NULL, | ||
"senderAddress" TEXT NOT NULL, | ||
"status" "TransactionStatus" NOT NULL DEFAULT 'pending', | ||
|
||
CONSTRAINT "PendingNftTransaction_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "PendingNftTransaction_userId_idx" ON "PendingNftTransaction"("userId"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "PendingNftTransaction_status_idx" ON "PendingNftTransaction"("status"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "PendingNftTransaction_sourceChainTxHash_sourceChainId_key" ON "PendingNftTransaction"("sourceChainTxHash", "sourceChainId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "PendingNftTransaction_destinationChainTxHash_destinationCha_key" ON "PendingNftTransaction"("destinationChainTxHash", "destinationChainId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "PendingNftTransaction" ADD CONSTRAINT "PendingNftTransaction_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Scout"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters