From 10a0f2a1a28091515e660332fdff082e2f6a92a8 Mon Sep 17 00:00:00 2001 From: "M.Palerme" Date: Fri, 14 Jun 2024 08:34:20 +0200 Subject: [PATCH] #48 add ratio table in database --- db/init.js | 8 ++++++++ db/init.sql | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/db/init.js b/db/init.js index 6bb3033..a3791c0 100644 --- a/db/init.js +++ b/db/init.js @@ -124,6 +124,14 @@ client.connect() id_file SERIAL REFERENCES file (id) ON DELETE CASCADE, PRIMARY KEY (id_series, id_file) ); + + CREATE TABLE ratio + ( + id_mol VARCHAR(52) UNIQUE, + id_series SERIAL REFERENCES series (id) ON DELETE CASCADE, + ratio FLOAT, + PRIMARY KEY (id_mol, id_series) + ); INSERT INTO users (name, email, hash, team) VALUES diff --git a/db/init.sql b/db/init.sql index 24f6a21..d69af67 100644 --- a/db/init.sql +++ b/db/init.sql @@ -118,6 +118,14 @@ CREATE TABLE daughter PRIMARY KEY (id_series, id_file) ); +CREATE TABLE ratio +( + id_mol VARCHAR(52) UNIQUE, + id_series SERIAL REFERENCES series (id) ON DELETE CASCADE, + ratio FLOAT, + PRIMARY KEY (id_mol, id_series) +); + INSERT INTO users (name, email, hash, team) VALUES ('root_ep2m2', 'admin@ep2m2.bzh',