From e0eb0aebf796888b3f2f1fb44fb6cabc53cad9ce Mon Sep 17 00:00:00 2001 From: knhn1004 <49494541+knhn1004@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:53:42 -0700 Subject: [PATCH] update createdb.sql --- db-scripts/createdb.sql | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/db-scripts/createdb.sql b/db-scripts/createdb.sql index 284f8e5..7a73c90 100644 --- a/db-scripts/createdb.sql +++ b/db-scripts/createdb.sql @@ -1,4 +1,5 @@ -create database acm_website if not exists; +SELECT 'CREATE DATABASE acm_website' +WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'acm_website')\gexec \c acm_website; @@ -35,8 +36,8 @@ create table if not exists session( id text not null, user_id text not null, created_at timestamp not null, - active_expires number not null, - idle_expires number not null, + active_expires BIGINT not null, + idle_expires BIGINT not null, PRIMARY KEY(id), FOREIGN KEY(user_id) REFERENCES users(id) on update cascade on delete cascade );