From 9a4f8e15b46fe1fb4d8758b2868351fed37aba08 Mon Sep 17 00:00:00 2001 From: nochill Date: Tue, 19 Sep 2023 21:48:23 +0700 Subject: [PATCH] add images seeder --- import_csv.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/import_csv.sh b/import_csv.sh index 896d6b7..5444616 100755 --- a/import_csv.sh +++ b/import_csv.sh @@ -7,6 +7,7 @@ sudo -u postgres psql \ -c '\copy regencies(id, province_id, regency_name) FROM '"'/tmp/kabupaten.csv'"' DELIMITER '"','"' CSV HEADER;' \ -c '\copy locations(id,address,name,submitted_by,thumbnail,regency_id,google_maps_link,approved_by) FROM '"'/tmp/locations.csv'"' DELIMITER '"'#'"' CSV HEADER;' \ -c '\copy reviews(id,submitted_by,is_from_critic,comments,score,is_hided,location_id) FROM '"'/tmp/reviews.csv'"' DELIMITER '"'#'"' CSV HEADER;' \ + -c '\copy images(id,image_url,uploaded_by,image_type,image_of) FROM '"'/tmp/images.csv'"' DELIMITER '"'#'"' CSV HEADER;' \ -d hiling_dev && sudo -u postgres psql \ -c '\copy users(id,username,password) FROM '"'/tmp/user.csv'"' DELIMITER '"','"' CSV HEADER;' \ @@ -15,6 +16,7 @@ sudo -u postgres psql \ -c '\copy regencies(id, province_id, regency_name) FROM '"'/tmp/kabupaten.csv'"' DELIMITER '"','"' CSV HEADER;' \ -c '\copy locations(id,address,name,submitted_by,thumbnail,regency_id,google_maps_link,approved_by) FROM '"'/tmp/locations.csv'"' DELIMITER '"'#'"' CSV HEADER;' \ -c '\copy reviews(id,submitted_by,is_from_critic,comments,score,is_hided,location_id) FROM '"'/tmp/reviews.csv'"' DELIMITER '"'#'"' CSV HEADER;' \ + -c '\copy images(id,image_url,uploaded_by,image_type,image_of) FROM '"'/tmp/images.csv'"' DELIMITER '"'#'"' CSV HEADER;' \ -d hiling_dev_test # FIXING SEQUENCES AFTER SEEDING