feat: add the concept of tags

Tags are attached to all magnet links provided by a given source, and
passed to actions. This allows for e.g. better categorization in
Bitmagnet.
This commit is contained in:
Marc Plano-Lesay 2025-05-04 15:41:02 +10:00
parent f19e02988f
commit c3764c125a
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
13 changed files with 240 additions and 11 deletions

View file

@ -0,0 +1,2 @@
DROP TABLE magnet_tags;
DROP TABLE tags;

View file

@ -0,0 +1,14 @@
CREATE TABLE tags
(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
name TEXT UNIQUE NOT NULL
);
CREATE TABLE magnet_tags
(
magnet_id INTEGER NOT NULL,
tag_id INTEGER NOT NULL,
FOREIGN KEY (magnet_id) REFERENCES magnets (id),
FOREIGN KEY (tag_id) REFERENCES tags (id),
PRIMARY KEY (magnet_id, tag_id)
);