create table reviews
(
id int PRIMARY KEY,
location_id int NOT NULL,
service_id int,
rating int ,
body VARCHAR(255),
created_at TIMESTAMP NOT NULL
) ;
create table ratings -- should be added to location
(
location_id int PRIMARY KEY,
rating int,
needs_updating INT DEFAULT 0,
num_ratings int NOT NULL DEFAULT 1
) ;
create table reviews
(
id int PRIMARY KEY,
location_id int NOT NULL,
service_id int,
rating int ,
body VARCHAR(255),
created_at TIMESTAMP NOT NULL
) ;
create table ratings -- should be added to location
(
location_id int PRIMARY KEY,
rating int,
needs_updating INT DEFAULT 0,
num_ratings int NOT NULL DEFAULT 1
) ;