Skip to content

Commit

Permalink
Update init.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
gftf2011 authored Jun 15, 2024
1 parent 2390f62 commit e9a017c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/test/postgres/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ psql $DB -c "CREATE TABLE IF NOT EXISTS users_schema.users(
lastname TEXT NOT NULL,
email TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
PRIMARY KEY (id)
CONSTRAINT pk_user_id PRIMARY KEY (id)
)"

# Create Indexes
psql $DB -c "CREATE UNIQUE INDEX idx_users_id ON users_schema.users (id)"
psql $DB -c "CREATE UNIQUE INDEX idx_users_email ON users_schema.users (email)"

psql $DB -c "CLUSTER users_schema.users USING idx_users_id"

psql $DB -c "CREATE TABLE IF NOT EXISTS notes_schema.notes(
id TEXT UNIQUE NOT NULL,
title TEXT NOT NULL,
Expand Down Expand Up @@ -49,4 +55,4 @@ psql $DB -c "ALTER SCHEMA users_schema OWNER TO $USER"
psql $DB -c "ALTER SCHEMA notes_schema OWNER TO $USER"

psql $DB -c "ALTER TABLE users_schema.users OWNER TO $USER"
psql $DB -c "ALTER TABLE notes_schema.notes OWNER TO $USER"
psql $DB -c "ALTER TABLE notes_schema.notes OWNER TO $USER"

0 comments on commit e9a017c

Please sign in to comment.