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:
parent
f19e02988f
commit
c3764c125a
13 changed files with 240 additions and 11 deletions
2
migrations/2025-05-04-035709_add_tags/down.sql
Normal file
2
migrations/2025-05-04-035709_add_tags/down.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
DROP TABLE magnet_tags;
|
||||
DROP TABLE tags;
|
||||
14
migrations/2025-05-04-035709_add_tags/up.sql
Normal file
14
migrations/2025-05-04-035709_add_tags/up.sql
Normal 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)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue