autobrr/internal
soup ebbd851a2e
feat(autobrrctl): add db migrate/seed/reset functionality (#934)
* add db seed/reset functionality

* speculative db migration support

* update postgresSchema

* refactor: only migrate data, no schema

* implement transaction in db migration function

* refactor db:seed and db:reset

added transaction to both and updated help message

* change table order

* skip on foreign key constraint violations

* skip feed_cache

* set constraints to null

* fix seed and reset

* simplify migrate func

This version of the function should behave similarly to the previous version, but with less repetition and by relying on PostgreSQL's automatic transaction handling, which starts a new transaction for each separate statement when not in a transaction block. Also, it prepares the insert statement only once for each table, which can significantly improve performance when there are many rows to insert.

* fixed release_action_status

* refactor db:seed and db:reset

* minor adjustment to const usage

* fixed usage examples

* refactor seed/migrate

* refactor(database): seed and convert

* refactor(database): make tables list sorted a-z

* chore(deps): go mod tidy

* refactor(database): convert improve log output

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-12-28 14:05:51 +01:00
..
action feat(actions): qBittorrent add priority handling (#1315) 2023-12-25 22:39:31 +01:00
announce feat(definitions): add expectations for test lines (#1257) 2023-11-18 15:41:39 +01:00
api chore: add LICENSE GPLv2-or-later (#897) 2023-05-01 16:21:59 +02:00
auth feat(auth): change password and username (#1295) 2023-12-26 15:50:57 +01:00
client chore: add LICENSE GPLv2-or-later (#897) 2023-05-01 16:21:59 +02:00
config fix(config): log level change causes panic (#1296) 2023-12-02 17:23:08 +01:00
database feat(autobrrctl): add db migrate/seed/reset functionality (#934) 2023-12-28 14:05:51 +01:00
domain feat(auth): change password and username (#1295) 2023-12-26 15:50:57 +01:00
download_client feat(clients): Transmission support seedtime and ratiolimit (#1211) 2023-10-31 00:38:23 +01:00
events chore: add LICENSE GPLv2-or-later (#897) 2023-05-01 16:21:59 +02:00
feed feat(feeds): add force run (#1243) 2023-11-18 21:54:53 +01:00
filter feat(filters): show enabled and disabled actions in list view (#1304) 2023-12-17 21:18:26 +01:00
http refactor(http): auth handlers (#1311) 2023-12-28 02:04:25 +01:00
indexer refactor(indexers): ANT improve freeleech support (#1302) 2023-12-25 13:48:58 +01:00
irc fix(irc): improve IRC handler management (#1269) 2023-12-12 20:29:43 +01:00
logger feat(logs): show full log event (#1096) 2023-09-10 12:28:10 +02:00
mock chore: add LICENSE GPLv2-or-later (#897) 2023-05-01 16:21:59 +02:00
notification feat(notifications): add LunaSea support (#1284) 2023-12-15 23:13:44 +01:00
release feat(filters): show enabled and disabled actions in list view (#1304) 2023-12-17 21:18:26 +01:00
scheduler feat(feeds): add scheduled cleanup (#1073) 2023-09-02 22:44:28 +02:00
server chore: add LICENSE GPLv2-or-later (#897) 2023-05-01 16:21:59 +02:00
update chore: add LICENSE GPLv2-or-later (#897) 2023-05-01 16:21:59 +02:00
user feat(auth): change password and username (#1295) 2023-12-26 15:50:57 +01:00
utils chore: add LICENSE GPLv2-or-later (#897) 2023-05-01 16:21:59 +02:00