mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 01:01:40 +03:00
15 lines
504 B
MySQL
15 lines
504 B
MySQL
|
-- CreateTable
|
||
|
CREATE TABLE "blobs" (
|
||
|
"workspace_id" VARCHAR NOT NULL,
|
||
|
"key" VARCHAR NOT NULL,
|
||
|
"size" INTEGER NOT NULL,
|
||
|
"mime" VARCHAR NOT NULL,
|
||
|
"created_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
"deleted_at" TIMESTAMPTZ(3),
|
||
|
|
||
|
CONSTRAINT "blobs_pkey" PRIMARY KEY ("workspace_id","key")
|
||
|
);
|
||
|
|
||
|
-- AddForeignKey
|
||
|
ALTER TABLE "blobs" ADD CONSTRAINT "blobs_workspace_id_fkey" FOREIGN KEY ("workspace_id") REFERENCES "workspaces"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|