Skip to content
Snippets Groups Projects
Commit c4453c7e authored by nicolas.paschoud's avatar nicolas.paschoud
Browse files

Editing the size of the paths field in the DB

parent e68ed4b8
No related branches found
No related tags found
No related merge requests found
......@@ -11,9 +11,9 @@ CREATE TABLE IF NOT EXISTS Users (
);
CREATE TABLE IF NOT EXISTS Paths (
paths varchar(50) NOT NULL,
paths varchar(400) NOT NULL,
login varchar(60) NOT NULL,
parent varchar(50),
parent varchar(400),
PRIMARY KEY (paths),
FOREIGN KEY (login) REFERENCES Users(login),
FOREIGN KEY (parent) REFERENCES Paths(paths)
......@@ -22,9 +22,10 @@ CREATE TABLE IF NOT EXISTS Paths (
CREATE TABLE IF NOT EXISTS Files (
file_id varchar(100) NOT NULL,
file_name varchar(50) NOT NULL,
paths varchar(50) NOT NULL,
paths varchar(400) NOT NULL,
lat FLOAT,
lng FLOAT,
addedon INT,
PRIMARY KEY (file_id),
FOREIGN KEY (paths) REFERENCES Paths(paths)
);
......
......@@ -57,6 +57,7 @@ function insertUser(login, passwd, callback){
* @param {string} parent Parent of the new folder
*/
function addPath(path, login, parent, callback){
if (parent) parent = "'" + parent + "'";
let q = `INSERT INTO Paths VALUES ('${path}', '${login}', ${parent});`;
con.query(q, function(err, res) {
if (err) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment