Repository navigation
3. Setup the database
yopox edited this page Sep 4, 2019
·
1 revision
The Dimensionneuse is a DIY template : it is meant to be hacked to suit your environment. In this page, you will find a configuration example for the database.
You can use any DBMS, here postgreSQL will be used.
Here's the table specification :
CREATE TABLE dimensionneuse
(
x integer,
px integer,
y integer,
py integer,
z integer,
pz integer,
location text,
material text,
volume text,
id text NOT NULL,
alive boolean NOT NULL DEFAULT true,
CONSTRAINT dimensionneuse_pkey PRIMARY KEY (id)
)-
x: Thexdimension of the object -
y: Theydimension of the object -
z: Thezdimension of the object -
px: The precision for thexmeasure (x±px) -
py: The precision for theymeasure (y±py) -
pz: The precision for thezmeasure (z±pz) -
location: Where the object will be stored -
material: The object's material (kind of wood, of metal, …) -
volume: The object's category (plank, cleat, …) -
id: The object's ID (generated) -
alive: True if the object is available
Once the database is setup, you need to change some informations on database/index.js :
const dbConfig = {
user: '…',
host: '127.0.0.1',
database: '…',
password: '…',
port: …,
}
const tableName = "…"In database/index.js, the plankID function is responsible for assigning planks ID.
By default the ID will be location-nb.
You can rewrite the function to change the format or use different numbering rules, but the ID needs to be unique !