Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table users (
- "user_id" serial not null primary key,
- "username" varchar not null unique ,
- "password" varchar not null,
- "email" varchar not null unique,
- "full_name" varchar,
- "birth_date" date ,
- "sex" varchar ,
- "bio" varchar ,
- "avatar" varchar
- );
- create table lobby (
- "lobby_id" serial not null primary key ,
- "creator" int not null references users (user_id),
- "title" varchar not null unique,
- "type" varchar not null,
- "logo" varchar,
- "history" text
- );
- create table chat_members (
- "chat_member" int not null references users(user_id),
- "policy" varchar not null,
- "lobby" int not null references lobby(lobby_id),
- primary key (chat_member, lobby)
- );
- create table messages (
- "sender" int not null references chat_members(chat_member),
- "date_time" timestamp not null,
- "message" varchar not null,
- "attachment" varchar
- );
Add Comment
Please, Sign In to add comment