update server and table create

This commit is contained in:
alexmorenograu 2021-03-24 11:45:56 +01:00
parent 18d4208ade
commit 768b5c220c
2 changed files with 11 additions and 2 deletions

View File

@ -2,7 +2,16 @@ const con = require('./connect.js');
con.con.connect(function(err) {
if (err) throw err;
let sql = 'CREATE TABLE smartTag2 (code VARCHAR(100) PRIMARY KEY, shelvingFk VARCHAR(10) FOREIGN KEY REFERENCES vn.shelving(code), level INT(11))';
let sql = `CREATE TABLE vn.smartTag (
code varchar(100) NOT NULL,
shelvingFk varchar(10) NULL,
\`level\` int(11) NULL,
CONSTRAINT \`PRIMARY\` PRIMARY KEY (code),
CONSTRAINT smartTag_FK FOREIGN KEY (shelvingFk) REFERENCES vn.shelving(code)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8
COLLATE=utf8_general_ci;`;
con.con.query(sql, function(err, result) {
if (err) throw err;
});

View File

@ -7,8 +7,8 @@ const dataLogIn = logIn.info;
exports.dataLogIn = dataLogIn;
app.use('/getNumShelving', require('./methods/setCollection'));
app.use('/bindShelving', require('./methods/bindShelvingTag'));
app.use('/insertTicket', require('./methods/bindTicketShelving'));
app.use('/bindShelving', require('./methods/bindShelvingTag'));
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);