Skip to content

Commit 86c6395

Browse files
author
marcselman
committed
Remove automatic session table creation and require manual setup
Removes `createTableIfMissing: true` from the session store configuration in `server/index.ts`, as it fails in production builds. A comment is added to instruct users to manually create the session table in their production database. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9b278ad5-3a45-420e-ba83-0847baf9924f Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 42787dab-c86b-4a95-8010-0e13c9ce9997 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/04133160-d2cd-42c9-82f0-4e08d800b951/9b278ad5-3a45-420e-ba83-0847baf9924f/i2DbLrq Replit-Helium-Checkpoint-Created: true
1 parent 23c08a9 commit 86c6395

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ app.use(
3131
session({
3232
store: new PgStore({
3333
conString: process.env.DATABASE_URL,
34-
createTableIfMissing: true,
34+
// Note: Session table must be created manually in production.
35+
// Run this SQL: CREATE TABLE IF NOT EXISTS "session" (
36+
// "sid" varchar NOT NULL PRIMARY KEY,
37+
// "sess" json NOT NULL,
38+
// "expire" timestamp(6) NOT NULL
39+
// ); CREATE INDEX IF NOT EXISTS "IDX_session_expire" ON "session" ("expire");
3540
}),
3641
secret: process.env.SESSION_SECRET,
3742
resave: false,

0 commit comments

Comments
 (0)