mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(filters): max downloads per filter check (#660)
This commit is contained in:
parent
05edb7c7a7
commit
21c02dfab0
6 changed files with 104 additions and 19 deletions
|
@ -264,12 +264,14 @@ CREATE TABLE release_action_status
|
|||
type TEXT NOT NULL,
|
||||
client TEXT,
|
||||
filter TEXT,
|
||||
filter_id INTEGER,
|
||||
rejections TEXT [] DEFAULT '{}' NOT NULL,
|
||||
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
raw TEXT,
|
||||
log TEXT,
|
||||
release_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (release_id) REFERENCES "release"(id) ON DELETE CASCADE
|
||||
FOREIGN KEY (release_id) REFERENCES "release"(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (filter_id) REFERENCES "filter"(id) ON DELETE SET NULL
|
||||
);
|
||||
|
||||
CREATE INDEX release_action_status_release_id_index
|
||||
|
@ -631,4 +633,18 @@ CREATE INDEX indexer_identifier_index
|
|||
ALTER TABLE "filter"
|
||||
ADD COLUMN except_language TEXT [] DEFAULT '{}';
|
||||
`,
|
||||
`ALTER TABLE release_action_status
|
||||
ADD filter_id INTEGER;
|
||||
|
||||
CREATE INDEX release_action_status_filter_id_index
|
||||
ON release_action_status (filter_id);
|
||||
|
||||
ALTER TABLE release_action_status
|
||||
ADD CONSTRAINT release_action_status_filter_id_fk
|
||||
FOREIGN KEY (filter_id) REFERENCES filter;
|
||||
|
||||
UPDATE release_action_status
|
||||
SET filter_id = (SELECT f.id
|
||||
FROM filter f WHERE f.name = release_action_status.filter);
|
||||
`,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue