Skip to content

Commit

Permalink
update createdb.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
knhn1004 committed Oct 4, 2024
1 parent b4f2649 commit e0eb0ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions db-scripts/createdb.sql
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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
);
Expand Down

0 comments on commit e0eb0ae

Please sign in to comment.