From b3360cdb36929a791cc8ac7195f0f6724d7df49b Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Sun, 25 Feb 2024 21:03:27 +0000 Subject: [PATCH] Remove unused Unit table Signed-off-by: Stefan Marr --- src/backend/db/db.sql | 10 +--------- src/backend/db/db.ts | 16 ---------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/backend/db/db.sql b/src/backend/db/db.sql index 82f4337e..047496b6 100644 --- a/src/backend/db/db.sql +++ b/src/backend/db/db.sql @@ -22,13 +22,6 @@ CREATE TABLE Environment ( note text ); --- The unit of a measure. -CREATE TABLE Unit ( - name varchar primary key, - description text, - lessIsBetter boolean -); - -- A specific criterion that is measured for a benchmark. -- This can be anything, from total time over memory consumption -- to other things or parts worth measuring. @@ -37,8 +30,7 @@ CREATE TABLE Criterion ( name varchar, unit varchar, - unique (name, unit), - foreign key (unit) references Unit (name) + unique (name, unit) ); -- Groups all the data that belongs together. diff --git a/src/backend/db/db.ts b/src/backend/db/db.ts index 71aa1963..916e8b42 100644 --- a/src/backend/db/db.ts +++ b/src/backend/db/db.ts @@ -828,21 +828,6 @@ export abstract class Database { return exp; } - private async recordUnit(unitName: string) { - const result = await this.query({ - name: 'fetchUnitByName', - text: 'SELECT * from Unit WHERE name = $1', - values: [unitName] - }); - if (result.rowCount === 0) { - await this.query({ - name: 'insertUnit', - text: 'INSERT INTO Unit (name) VALUES ($1)', - values: [unitName] - }); - } - } - public async recordCriterion(c: ApiCriterion): Promise { const cacheKey = `${c.c}::${c.u}`; @@ -850,7 +835,6 @@ export abstract class Database { return this.criteria.get(cacheKey); } - await this.recordUnit(c.u); return this.recordCached( this.criteria, cacheKey,