mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
Feature: Support multiple action status per release (#69)
* feat: move release actions to separate table * chore: update sqlite driver
This commit is contained in:
parent
2ea2293745
commit
e03eac24ba
12 changed files with 284 additions and 91 deletions
|
@ -143,7 +143,6 @@ CREATE TABLE "release"
|
|||
(
|
||||
id INTEGER PRIMARY KEY,
|
||||
filter_status TEXT,
|
||||
push_status TEXT,
|
||||
rejections TEXT [] DEFAULT '{}' NOT NULL,
|
||||
indexer TEXT,
|
||||
filter TEXT,
|
||||
|
@ -190,6 +189,20 @@ CREATE TABLE "release"
|
|||
uploader TEXT,
|
||||
pre_time TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE release_action_status
|
||||
(
|
||||
id INTEGER PRIMARY KEY,
|
||||
status TEXT,
|
||||
action TEXT NOT NULL,
|
||||
type TEXT NOT NULL,
|
||||
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)
|
||||
);
|
||||
`
|
||||
|
||||
var migrations = []string{
|
||||
|
@ -247,6 +260,27 @@ var migrations = []string{
|
|||
pre_time TEXT
|
||||
);
|
||||
`,
|
||||
`
|
||||
CREATE TABLE release_action_status
|
||||
(
|
||||
id INTEGER PRIMARY KEY,
|
||||
status TEXT,
|
||||
action TEXT NOT NULL,
|
||||
type TEXT NOT NULL,
|
||||
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)
|
||||
);
|
||||
|
||||
INSERT INTO "release_action_status" (status, action, type, timestamp, release_id)
|
||||
SELECT push_status, 'DEFAULT', 'QBITTORRENT', timestamp, id FROM "release";
|
||||
|
||||
ALTER TABLE "release"
|
||||
DROP COLUMN push_status;
|
||||
`,
|
||||
}
|
||||
|
||||
func Migrate(db *sql.DB) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue