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?
0 Replies
Okay after reading it one more time I would simply recommend you to use the psql tool to do that
You would need to follow these steps:
Install psql on your system
Copy database public url from service environment tab
Connect to the database with psql using the public url
Copy and paste that create table query and press enter
Unfortunately the data tab has very limited functionality, and doesn't support advanced operations such as setting up constraints
I was confused and spent alot of time trying to search for the raw sql query option 💀
because of this changelog i stumbled upon: https://railway.com/changelog/2021-10-22#raw-sql-queries
a year ago
!s
Status changed to Solved brody • 11 months ago