Commit graph

16 commits

Author SHA1 Message Date
1ea09c1a45 feat: use Alembic to initialize the database
This completely removes the previous DB patching mechanism.
When this is first run for an existing installation of Unwind, depending
on its version it might lead to problems because the database's schema
won't match the code.
To avoid that issue, when upgrading Unwind to this version make sure to
STOP the old application, install this new version but DON'T start it,
instead use `alembic upgrade head` to run the outstanding patches, and
only then start the application.
2024-05-19 02:25:36 +02:00
8fc594b947 fix: some lint reported by Ruff 2024-05-11 19:00:27 +02:00
05d387a6b5 fix: tests sometimes failed because of missing sorting 2024-05-11 17:29:30 +02:00
4981de4a04 remove databases, use SQLAlechemy 2.0 instead
Among the many changes we switch to using SQLAlchemy's connection pool,
which means we are no longer required to guard against multiple threads
working on the database.
All db funcs now receive a connection to use as their first argument,
this allows the caller to control transaction & rollback behavior.
2023-11-27 23:24:35 +01:00
25f31db756 improve strict typing 2023-07-22 20:13:46 +02:00
37e8d53b78 migrate db.current_patch_level to SQLAlchemy 2023-03-28 23:03:35 +02:00
84bbe331ee migrate db.find_movies to SQLAlchemy 2023-03-28 21:50:15 +02:00
1fd7e730b3 migrate db.ratings_for_movies to SQLAlchemy 2023-03-28 21:50:15 +02:00
b91fcd3f55 migrate db.add, db.update, db.remove to SQLA 2023-03-23 22:49:17 +01:00
6f6354cfac migrate db.get to SQLAlchemy 2023-03-20 21:37:50 +01:00
af9c166124 migrate db.get_many to SQLAlchemy 2023-03-19 23:14:59 +01:00
a444909b1f minor refactoring 2023-03-19 22:59:08 +01:00
1dd7bab4aa migrate db.get_all to pure SQLAlchemy 2023-03-19 22:36:33 +01:00
9ffcc53571 apply auto-formatting to tests 2023-02-04 18:15:14 +01:00
324eb8e9b7 fix tests for Pytest-Asyncio running in strict mode 2023-02-04 18:12:50 +01:00
e1f35143df add some tests for db.find_ratings 2021-12-19 19:30:08 +01:00