You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have made 2 SQL files for your schema (db_build.sql & test_db.sql)
Suggestion :
you can make 1 SQL file to your schema
BEGIN;
DROPTABLE IF EXISTS users, places CASCADE;
CREATETABLEusers (
user_id SERIALPRIMARY KEY,
user_name VARCHAR(20) NOT NULL,
email VARCHAR UNIQUE,
phone INT UNIQUE
); & so on
then you don't need to repeat the same commands to create tables and add constraints on db_test.js file
you can add the fake_data just.
As :
INSERT INTO users(user_name,email,phone) VALUES ('Sajeda','[email protected]',0599789523);
INSERT INTO users(user_name,email,phone) VALUES ('Fares','[email protected]',0599289523);
INSERT INTO places(place_name,location,service,delivery,image,user_id) VALUES ('take-break','gaza','food',true,'https://images.unsplash.com/photo-1541745537411-b8046dc6d66c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=334&q=80',1);
INSERT INTO places(place_name,location,service,delivery,image,user_id) VALUES ('abdallah','gaza','food',true,'https://images.unsplash.com/photo-1541745537411-b8046dc6d66c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=334&q=80',2);
JUST
The text was updated successfully, but these errors were encountered:
You have made 2 SQL files for your schema (db_build.sql & test_db.sql)
Suggestion :
you can make 1 SQL file to your schema
then you don't need to repeat the same commands to create tables and add constraints on
db_test.js
fileyou can add the fake_data just.
As :
The text was updated successfully, but these errors were encountered: