Skip to content

Commit

Permalink
#48 add series table in database
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcellino-Palerme committed Jun 12, 2024
1 parent acad7fb commit f04254e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 16 deletions.
38 changes: 30 additions & 8 deletions db/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,38 @@ client.connect()
CREATE VIEW view_usable_machine AS
SELECT *
FROM machine
WHERE archive_date IS NULL;
WHERE archive_date IS NULL;
CREATE TABLE series
(
id SERIAL PRIMARY KEY,
name VARCHAR(255),
date_create TIMESTAMPTZ NOT NULL,
date_achieved TIMESTAMPTZ,
used INTEGER,
id_machine SERIAL REFERENCES machine (id)
);
INSERT INTO users (name, email, hash, team)
VALUES ('root_ep2m2', '[email protected]', '$2b$10$M1yCnD1pGQ6LXDh0IeR94uRcFOlikhs2uFKvqdWaJ3wbmnFPERquy', 'other'),
('poire', '[email protected]', '$2b$10$O0YmpmJkTPWoRI8KBYWQLOy6/LcCwM/gd/zoD1PpWl2oYLHRm3M9y', 'IFPC'),
('rang', '[email protected]', '$2b$10$hFQTt27G0NRDFpjEBWanzezG379TaFbY4XCEx51cQPREFSOvcAvLK', 'P2M2'),
('huile', '[email protected]', '$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'IFPC'),
('huile', '[email protected]', '$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'P2M2'),
('huile', '[email protected]', '$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'other'),
('alors', '[email protected]', '$2b$10$lykg9yaKuuuEAybe4bSimebtuxQS6zkIpBlO8dG47pIbVzjbrNzIO', 'P2M2');
VALUES
('root_ep2m2', '[email protected]',
'$2b$10$M1yCnD1pGQ6LXDh0IeR94uRcFOlikhs2uFKvqdWaJ3wbmnFPERquy', 'other'),
('poire', '[email protected]',
'$2b$10$O0YmpmJkTPWoRI8KBYWQLOy6/LcCwM/gd/zoD1PpWl2oYLHRm3M9y', 'IFPC'),
('rang', '[email protected]',
'$2b$10$hFQTt27G0NRDFpjEBWanzezG379TaFbY4XCEx51cQPREFSOvcAvLK', 'P2M2'),
('huile', '[email protected]',
'$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'IFPC'),
('huile', '[email protected]',
'$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'P2M2'),
('huile', '[email protected]',
'$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'other'),
('alors', '[email protected]',
'$2b$10$lykg9yaKuuuEAybe4bSimebtuxQS6zkIpBlO8dG47pIbVzjbrNzIO', 'P2M2'),
('art', '[email protected]',
'$2b$10$bHdSEKlQ.emIxs.EoWRSHOo2Kv7ah1iNuVq.j0rn09nDefDkZS.my', 'P2M2'),
('tshirt', '[email protected]',
'$2b$10$bHUWHvZA4jUWg9.MNAae3uMHR2kpk0c6nErgs/Fce1ZTCLUUqD/sO', 'P2M2');
Expand Down
37 changes: 29 additions & 8 deletions db/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,33 @@ SELECT *
FROM machine
WHERE archive_date IS NULL;

INSERT INTO users (name, email, hash, team)
VALUES ('root_ep2m2', '[email protected]', '$2b$10$M1yCnD1pGQ6LXDh0IeR94uRcFOlikhs2uFKvqdWaJ3wbmnFPERquy', 'other'),
('poire', '[email protected]', '$2b$10$O0YmpmJkTPWoRI8KBYWQLOy6/LcCwM/gd/zoD1PpWl2oYLHRm3M9y', 'IFPC'),
('rang', '[email protected]', '$2b$10$hFQTt27G0NRDFpjEBWanzezG379TaFbY4XCEx51cQPREFSOvcAvLK', 'P2M2'),
('huile', '[email protected]', '$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'IFPC'),
('huile', '[email protected]', '$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'P2M2'),
('huile', '[email protected]', '$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'other'),
('alors', '[email protected]', '$2b$10$lykg9yaKuuuEAybe4bSimebtuxQS6zkIpBlO8dG47pIbVzjbrNzIO', 'P2M2');
CREATE TABLE series
(
id SERIAL PRIMARY KEY,
name VARCHAR(255),
date_create TIMESTAMPTZ NOT NULL,
date_achieved TIMESTAMPTZ,
used INTEGER,
id_machine SERIAL REFERENCES machine (id)
);

INSERT INTO users (name, email, hash, team)
VALUES
('root_ep2m2', '[email protected]',
'$2b$10$M1yCnD1pGQ6LXDh0IeR94uRcFOlikhs2uFKvqdWaJ3wbmnFPERquy', 'other'),
('poire', '[email protected]',
'$2b$10$O0YmpmJkTPWoRI8KBYWQLOy6/LcCwM/gd/zoD1PpWl2oYLHRm3M9y', 'IFPC'),
('rang', '[email protected]',
'$2b$10$hFQTt27G0NRDFpjEBWanzezG379TaFbY4XCEx51cQPREFSOvcAvLK', 'P2M2'),
('huile', '[email protected]',
'$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'IFPC'),
('huile', '[email protected]',
'$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'P2M2'),
('huile', '[email protected]',
'$2b$10$t6wa72bsTJYM/CUENcMEluCv9ucDu4xd/5SvGQMfVQOfvfUb4nL4u', 'other'),
('alors', '[email protected]',
'$2b$10$lykg9yaKuuuEAybe4bSimebtuxQS6zkIpBlO8dG47pIbVzjbrNzIO', 'P2M2'),
('art', '[email protected]',
'$2b$10$bHdSEKlQ.emIxs.EoWRSHOo2Kv7ah1iNuVq.j0rn09nDefDkZS.my', 'P2M2'),
('tshirt', '[email protected]',
'$2b$10$bHUWHvZA4jUWg9.MNAae3uMHR2kpk0c6nErgs/Fce1ZTCLUUqD/sO', 'P2M2');

0 comments on commit f04254e

Please sign in to comment.