This repository has been archived on 2024-10-02. You can view files and clone it, but cannot push or open issues or pull requests.
smart-tag/db/create.js

19 lines
560 B
JavaScript
Raw Normal View History

2021-03-18 10:38:28 +00:00
const con = require('./connect.js');
2021-03-12 11:53:52 +00:00
con.con.connect(function(err) {
if (err) throw err;
2021-03-24 10:45:56 +00:00
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;`;
2021-03-18 10:38:28 +00:00
con.con.query(sql, function(err, result) {
if (err) throw err;
2021-03-12 11:53:52 +00:00
});
2021-03-18 10:38:28 +00:00
});