Mirrors the node:sqlite sub-backend structure with full migration support. Uses native pg types (UUID, JSONB, TIMESTAMPTZ) and $1/$2 parameterisation via internal ? placeholders converted at execution time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 lines
315 B
SQL
8 lines
315 B
SQL
CREATE TABLE "sessions" (
|
|
"uid" UUID NOT NULL REFERENCES "users"("uid") ON DELETE CASCADE,
|
|
"token" TEXT NOT NULL PRIMARY KEY,
|
|
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
"expires_at" TIMESTAMPTZ NOT NULL DEFAULT NOW() + INTERVAL '7 days'
|
|
);
|