Skip to content

Commit

Permalink
feat: Store extra data in the database for efficiency's sake
Browse files Browse the repository at this point in the history
Extra data:

* Redmine project ID
* Redmine issue subject
* Redmine activity name
  • Loading branch information
kusalananda committed Oct 21, 2024
1 parent 0c04bc3 commit d19437c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backend/sql/schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- The relational database schema for Urdr, storing the data that is not
-- kept by Redmine by default but that we need to be persistent between
-- sessions.
-- sessions. We also store some data here for efficiency reasons.
--
-- We assume that this file is used to initialize a SQLite database.
-- The Go code does thes automatically, but you may also do so from the
Expand Down Expand Up @@ -64,12 +64,21 @@ CREATE TABLE user_setting (
-- a hidden entry. We also store a sorting priority, which determines
-- the relative positioning in the user interface (it's essentially a
-- sorting key).
--
-- For reasons of efficiency, we additionally store the Redmine project
-- ID and name, the Redmine issue subject, and the Redmine activity
-- name. This is not strictly necessary, but it makes it easier to
-- display the data in the user interface without having to query the
-- Redmine API for each entry.

DROP TABLE IF EXISTS priority_entry;
CREATE TABLE priority_entry (
redmine_user_id INTEGER NOT NULL,
redmine_project_id INTEGER NOT NULL,
redmine_issue_id INTEGER NOT NULL,
redmine_issue_subject TEXT,
redmine_activity_id INTEGER NOT NULL,
redmine_activity_name TEXT,
name TEXT,
is_hidden BOOLEAN,
priority INTEGER NOT NULL,
Expand Down

0 comments on commit d19437c

Please sign in to comment.