-
Notifications
You must be signed in to change notification settings - Fork 14
/
db_create.sql
128 lines (115 loc) · 3.3 KB
/
db_create.sql
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
### Created By Dev Adnani
create table events (
event_id bigint not null primary key,
event_image text not null,
event_type text not null,
event_name text not null,
event_location text not null,
event_date text not null,
event_charges integer not null
);
create table rooms (
room_id bigint not null primary key,
created_at text not null,
room_name text not null,
room_type text not null,
room_address text not null,
room_price integer not null,
room_amenities_text ARRAY not null,
room_photos ARRAY not null,
room_status boolean not null,
room_rating real not null,
room_description text not null,
room_amenities_image ARRAY not null,
room_phone_call integer not null,
room_lat double not null,
room_long double not null
);
create table feedback (
feedback_id bigint not null primary key,
created_at text not null,
feedback_title text not null,
feedback_description text not null,
feedback_stars real not null,
user_id bigint not null
);
create table users (
user_id bigint not null primary key,
created_at text not null,
user_name text not null,
user_email text not null,
user_password text not null,
user_phone_no text not null,
user_profile_url text
);
create table favourite (
favourite_id bigint not null primary key,
user_id bigint references users (user_id),
room_id bigint references rooms (room_id)
);
create table bookings (
bookings_id bigint not null primary key,
room_id bigint references rooms (room_id),
user_id bigint references users (user_id),
booking_price bigint not null,
booking_razorid character not null,
booking_start_date character not null,
booking_end_date character not null
);
create table events (
event_id bigint not null primary key,
event_image text not null,
event_type text not null,
event_name text not null,
event_location text not null,
event_date text not null,
event_charges integer not null
);
create table rooms (
room_id bigint not null primary key,
created_at text not null,
room_name text not null,
room_type text not null,
room_address text not null,
room_price integer not null,
room_amenities_text ARRAY not null,
room_photos ARRAY not null,
room_status boolean not null,
room_rating real not null,
room_description text not null,
room_amenities_image ARRAY not null,
room_phone_call integer not null,
room_lat double not null,
room_long double not null
);
create table feedback (
feedback_id bigint not null primary key,
created_at text not null,
feedback_title text not null,
feedback_description text not null,
feedback_stars real not null,
user_id bigint not null
);
create table users (
user_id bigint not null primary key,
created_at text not null,
user_name text not null,
user_email text not null,
user_password text not null,
user_phone_no text not null,
user_profile_url text
);
create table favourite (
favourite_id bigint not null primary key,
user_id bigint references users (user_id),
room_id bigint references rooms (room_id)
);
create table bookings (
bookings_id bigint not null primary key,
room_id bigint references rooms (room_id),
user_id bigint references users (user_id),
booking_price bigint not null,
booking_razorid character not null,
booking_start_date character not null,
booking_end_date character not null
);