added comment column for visits
This commit is contained in:
parent
4c28ef12b5
commit
b14105ec28
@ -44,6 +44,7 @@ con.connect(function(err) {
|
|||||||
id int NOT NULL AUTO_INCREMENT,\
|
id int NOT NULL AUTO_INCREMENT,\
|
||||||
date varchar(255),\
|
date varchar(255),\
|
||||||
img varchar(255),\
|
img varchar(255),\
|
||||||
|
comment varchar(1000),\
|
||||||
site_id int,\
|
site_id int,\
|
||||||
FOREIGN KEY (site_id) REFERENCES sites(id),\
|
FOREIGN KEY (site_id) REFERENCES sites(id),\
|
||||||
PRIMARY KEY (id)\
|
PRIMARY KEY (id)\
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
var con = require('./db');
|
var con = require('./db');
|
||||||
|
|
||||||
sql = "INSERT INTO visits (date, img, site_id) VALUES ?";
|
sql = "INSERT INTO visits (date, img, comment, site_id) VALUES ?";
|
||||||
val = [
|
val = [
|
||||||
['10-15-2019','https://seanland.ca', '203'],
|
['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', '169'],
|
['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', '520'],
|
['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', '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){
|
con.query(sql, [val], function(err, res){
|
||||||
|
@ -17,6 +17,7 @@ block content
|
|||||||
h2(class="visits")= "Visits"
|
h2(class="visits")= "Visits"
|
||||||
each visit in visits
|
each visit in visits
|
||||||
p #{visit.date}: #{visit.img} at the site: #{visit.site_id}
|
p #{visit.date}: #{visit.img} at the site: #{visit.site_id}
|
||||||
|
p #{visit.comment}
|
||||||
else
|
else
|
||||||
h2(class="visits")= "This site has yet to be visited. Soon... "
|
h2(class="visits")= "This site has yet to be visited. Soon... "
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user