Skip to content

Commit 96824d2

Browse files
authored
Merge pull request #1002 from OpensrcLord/fix/init-migration-postgres-types
fix: replace SQLite DATETIME with PostgreSQL TIMESTAMP(3) in init migration
2 parents 1452d6c + 947f718 commit 96824d2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

backend/prisma/migrations/20260221132622_init/migration.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
CREATE TABLE "User" (
33
"id" TEXT NOT NULL PRIMARY KEY,
44
"publicKey" TEXT NOT NULL,
5-
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
6-
"updatedAt" DATETIME NOT NULL
5+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
6+
"updatedAt" TIMESTAMP(3) NOT NULL
77
);
88

99
-- CreateTable
@@ -19,8 +19,8 @@ CREATE TABLE "Stream" (
1919
"startTime" INTEGER NOT NULL,
2020
"lastUpdateTime" INTEGER NOT NULL,
2121
"isActive" BOOLEAN NOT NULL DEFAULT true,
22-
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
23-
"updatedAt" DATETIME NOT NULL,
22+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
23+
"updatedAt" TIMESTAMP(3) NOT NULL,
2424
CONSTRAINT "Stream_sender_fkey" FOREIGN KEY ("sender") REFERENCES "User" ("publicKey") ON DELETE RESTRICT ON UPDATE CASCADE,
2525
CONSTRAINT "Stream_recipient_fkey" FOREIGN KEY ("recipient") REFERENCES "User" ("publicKey") ON DELETE RESTRICT ON UPDATE CASCADE
2626
);
@@ -35,7 +35,7 @@ CREATE TABLE "StreamEvent" (
3535
"ledgerSequence" INTEGER NOT NULL,
3636
"timestamp" INTEGER NOT NULL,
3737
"metadata" TEXT,
38-
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
38+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
3939
CONSTRAINT "StreamEvent_streamId_fkey" FOREIGN KEY ("streamId") REFERENCES "Stream" ("streamId") ON DELETE RESTRICT ON UPDATE CASCADE
4040
);
4141

0 commit comments

Comments
 (0)