From b14105ec2843faf342ac807117348c6a067c29ee Mon Sep 17 00:00:00 2001 From: Sean Clarke Date: Mon, 13 Jan 2020 13:21:16 -0500 Subject: [PATCH] added comment column for visits --- database/build.js | 1 + database/fill-visits.js | 10 +++++----- views/site.pug | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/database/build.js b/database/build.js index 322fa31..b77040b 100644 --- a/database/build.js +++ b/database/build.js @@ -44,6 +44,7 @@ con.connect(function(err) { id int NOT NULL AUTO_INCREMENT,\ date varchar(255),\ img varchar(255),\ + comment varchar(1000),\ site_id int,\ FOREIGN KEY (site_id) REFERENCES sites(id),\ PRIMARY KEY (id)\ diff --git a/database/fill-visits.js b/database/fill-visits.js index f71f5fa..c68b138 100644 --- a/database/fill-visits.js +++ b/database/fill-visits.js @@ -1,11 +1,11 @@ var con = require('./db'); -sql = "INSERT INTO visits (date, img, site_id) VALUES ?"; +sql = "INSERT INTO visits (date, img, comment, site_id) VALUES ?"; val = [ - ['10-15-2019','https://seanland.ca', '203'], - ['10-17-2019','https://seanland.ca', '169'], - ['01-17-2020','https://seanland.ca', '520'], - ['11-23-2019','https://seanland.ca', '520'] + ['10-15-2019','https://seanland.ca', 'This is a comment about the place I went, or some details max 1000 characters. They are not supposed to be super long - but you can write a bit.' ,'203'], + ['10-17-2019','https://seanland.ca', 'This is a comment about the place I went, or some details max 1000 characters. They are not supposed to be super long - but you can write a bit.' ,'169'], + ['01-17-2020','https://seanland.ca', 'This is a comment about the place I went, or some details max 1000 characters. They are not supposed to be super long - but you can write a bit.' ,'520'], + ['11-23-2019','https://seanland.ca', 'This is a comment about the place I went, or some details max 1000 characters. They are not supposed to be super long - but you can write a bit.' ,'520'] ]; con.query(sql, [val], function(err, res){ diff --git a/views/site.pug b/views/site.pug index b8e2fb3..75dbc6c 100644 --- a/views/site.pug +++ b/views/site.pug @@ -17,6 +17,7 @@ block content h2(class="visits")= "Visits" each visit in visits p #{visit.date}: #{visit.img} at the site: #{visit.site_id} + p #{visit.comment} else h2(class="visits")= "This site has yet to be visited. Soon... "