-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
27 lines (22 loc) · 732 Bytes
/
Copy pathdatabase.sql
File metadata and controls
27 lines (22 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
CREATE DATABASE my_sendit;
--- create an extension
--- create users table
CREATE TABLE IF NOT EXISTS users(
id serial PRIMARY KEY,
first_name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
email VARCHAR UNIQUE NOT NULL,
phone_no VARCHAR NOT NULL,
password VARCHAR NOT NULL,
role VARCHAR DEFAULT 'member'
);
--create parcels table
CREATE TABLE IF NOT EXISTS parcels(
id serial PRIMARY KEY,
user_id INTEGER REFERENCES users(id),
pickup_location VARCHAR NOT NULL,
destination VARCHAR NOT NULL,
recipient_name VARCHAR NOT NULL,
recipient_phone_no VARCHAR NOT NULL,
status VARCHAR DEFAULT 'pending'
);