Added missing table to create SQL script

This commit is contained in:
Maciej Krzyżanowski 2023-02-28 23:55:05 +01:00
parent 7bba0ac404
commit e3b918550d
2 changed files with 13 additions and 0 deletions

1
app.js
View File

@ -10,6 +10,7 @@ require('dotenv').config();
const app = express();
const db = pgp(`postgres://${process.env.DB_USER}:${process.env.DB_PASS}@${process.env.DB_HOST}:${process.env.DB_PORT}/${process.env.DB_NAME}`);
const port = 5000;
class Point {

View File

@ -87,3 +87,15 @@ CREATE TABLE event (
account_nickname VARCHAR(32) REFERENCES account ON DELETE SET NULL ON UPDATE CASCADE,
osp_unit_id INTEGER REFERENCES osp_unit ON DELETE CASCADE ON UPDATE CASCADE
);
DROP TABLE IF EXISTS user_session CASCADE;
CREATE TABLE user_session (
"sid" varchar NOT NULL COLLATE "default",
"sess" json NOT NULL,
"expire" timestamp(6) NOT NULL
)
WITH (OIDS=FALSE);
ALTER TABLE user_session ADD CONSTRAINT "session_pkey" PRIMARY KEY ("sid") NOT DEFERRABLE INITIALLY IMMEDIATE;
CREATE INDEX "IDX_session_expire" ON user_session ("expire");