session
jasonandyquan
TRIALOP

a year ago

I'm struggling to create the session table, the one used by passport-local's pgsession, in railway's postgres database. For more info, I used the provided query from pg connect docs:

`CREATE TABLE "session" (
"sid" varchar NOT NULL COLLATE "default",
"sess" json NOT NULL,
"expire" timestamp(6) NOT NULL
)
WITH (OIDS=FALSE);

ALTER TABLE "session" ADD CONSTRAINT "session_pkey" PRIMARY KEY ("sid") NOT DEFERRABLE INITIALLY IMMEDIATE;

CREATE INDEX "IDXsessionexpire" ON "session" ("expire");`

Does anybody know how to create this table with railway's table view, or is there some sort of way to query it?

Solved

0 Replies

jasonandyquan
TRIALOP

a year ago

N/A


maddsua
HOBBY

a year ago

Hey, what problem are you experiencing exactly?


maddsua
HOBBY

a year ago

Okay after reading it one more time I would simply recommend you to use the psql tool to do that


maddsua
HOBBY

a year ago

You would need to follow these steps:

  1. Install psql on your system

  2. Copy database public url from service environment tab

  3. Connect to the database with psql using the public url

  4. Copy and paste that create table query and press enter


maddsua
HOBBY

a year ago

Unfortunately the data tab has very limited functionality, and doesn't support advanced operations such as setting up constraints


jasonandyquan
TRIALOP

a year ago

Got it, thanks man


jasonandyquan
TRIALOP

a year ago

I was confused and spent alot of time trying to search for the raw sql query option 💀


jasonandyquan
TRIALOP

a year ago

because of this changelog i stumbled upon: https://railway.com/changelog/2021-10-22#raw-sql-queries


maddsua
HOBBY

a year ago

ye lol they have removed it some time in the past


brody
EMPLOYEE

a year ago

!s


Status changed to Solved brody 11 months ago


Loading...