Commit Graph

189 Commits

Author SHA1 Message Date
Georges-Antoine Assi
43257cd386 fix romfile migration for empty files 2025-02-27 11:49:33 -05:00
Georges-Antoine Assi
cdfcf81d57 [HOTFIX] format collections migration 2025-02-21 15:28:13 -05:00
zurdi
cfbcd82547 fix: changes based on review 2025-02-17 11:10:24 +00:00
zurdi
5733770cd8 Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-02-14 12:09:39 +00:00
Michael Manganiello
7ba7da8d34 fix: Migration 0034 compatibility with MySQL
`DISTINCT` cannot be used within `JSON_ARRAYAGG` in MySQL, so it was
removed.

Also, the PostgreSQL query was simplified and now generates JSONB
columns, to be consistent with all the other tables.
2025-02-14 00:17:06 -03:00
zurdi
bd8a1f2547 fix: ss migrations 2025-02-12 12:54:00 +00:00
zurdi
2e3858d032 Merge branch 'master' into feature/screenscraper-integration 2025-02-12 12:41:08 +00:00
Georges-Antoine Assi
ec14c2c43a fix postgres dv view 2025-02-09 15:21:44 -05:00
Georges-Antoine Assi
88dc964ac4 Merge branch 'master' into romm-994 2025-02-08 21:28:38 -05:00
zurdi
9ae3b7da6f feat: added manuals to ss migration 2025-02-06 13:49:09 +00:00
zurdi
2393e1e3da Rename migration files and update platforms table with ss_id from SLUG_TO_SS_ID mapping 2025-02-06 09:19:19 +00:00
zurdi
5caf3ddc73 reordered migrations to fit master branch 2025-02-06 08:47:41 +00:00
zurdi
5951aecbd5 Update platforms table with ss_id from SLUG_TO_SS_ID mapping 2025-02-06 08:36:12 +00:00
zurdi
cce279a7e3 Merge branch 'master' into feature/screenscraper-integration 2025-02-04 12:34:22 +00:00
Michael Manganiello
86219bf6dd fix: Adapt new migrations to supported database engines
* Remove MySQL specific dialect.
* Fix migration `0033` to run on PostgreSQL.
* Correctly concatenate file paths by inserting a slash between path and
  file name.
2025-02-02 14:13:28 -03:00
zurdi
3a4c06f6e9 fix: rebase migrations 2025-01-31 00:16:52 +00:00
zurdi
9d96501b9e Merge remote-tracking branch 'origin/master' into feature/screenscraper-integration 2025-01-31 00:12:44 +00:00
Georges-Antoine Assi
81fd535091 fix down migration 2025-01-30 10:32:56 -05:00
Georges-Antoine Assi
cd724b7d1a migrate collections over to join table 2025-01-28 23:47:09 -05:00
Georges-Antoine Assi
5a79200617 bunch o fixes 2025-01-27 21:29:22 -05:00
Georges-Antoine Assi
10fbead892 autogenerate cover art 2025-01-27 20:26:33 -05:00
Georges-Antoine Assi
5dbc1aae0b display virtual collections 2025-01-27 19:14:54 -05:00
Georges-Antoine Assi
dbe4b71c7a super naive appraoch to loading virtual collections 2025-01-27 18:15:52 -05:00
Georges-Antoine Assi
12c27a1e5e migration to generate virtual collections 2025-01-27 10:38:18 -05:00
Georges-Antoine Assi
a35701396c Merge branch 'master' into rom-hashing-background-task 2025-01-25 23:30:15 -05:00
Georges-Antoine Assi
597961827e remove unnecessary migrations 2025-01-24 11:22:56 -05:00
Georges-Antoine Assi
b659ebe97f [ROMM-1529] 2025-01-23 19:29:16 -05:00
Michael Manganiello
fb622ff990 fix: Improve support for older PostgreSQL versions
Functions like `JSON_ARRAY` and `JSON_OBJECT` have been introduced in
PostgreSQL 16 [1]. Older PostgreSQL versions were failing to run the
migrations due to the usage of these functions.

This change uses `jsonb_build_array` and `jsonb_build_object` functions
in PostgreSQL, which have been available since PostgreSQL 9.5 [2].

[1]: https://www.postgresql.org/docs/release/16.0/
[2]: https://www.postgresql.org/docs/release/9.5.0/#AEN132010
2025-01-18 20:04:14 -03:00
Georges-Antoine Assi
65ee2ced9b rename migration 2025-01-17 15:24:08 -05:00
Georges-Antoine Assi
429958bfb3 Merge branch 'master' into rom-hashing-background-task 2025-01-17 14:39:45 -05:00
Georges-Antoine Assi
74dfee983f remove mods to user table in migration 2025-01-17 11:54:11 -05:00
Georges-Antoine Assi
346bbb2db3 Add category column to rom file 2025-01-16 10:49:47 -05:00
Georges-Antoine Assi
0ef2e03a9e fixes from migration 2025-01-15 21:56:24 -05:00
Georges-Antoine Assi
696a1c6122 Merge branch 'master' into rom-hashing-background-task 2025-01-15 21:51:23 -05:00
Georges-Antoine Assi
fefcc63fd1 fix server detault value 2025-01-13 22:10:04 -05:00
Georges-Antoine Assi
195b0cf742 [HOTFIX] Change all DateTime columns to TIMESTAMP 2025-01-13 21:53:00 -05:00
Michael Manganiello
6867486419 fix: Set users email to null if empty
When a user does not set an email address, we now set it to `NULL` in
the database. That bypasses the unique constraint on the `email` column,
allowing multiple users to have no email address set.

Fixes #1445.
2025-01-13 22:44:24 -03:00
zurdi
4aa2d49221 feat: fully integrated screenscrapper 2025-01-03 03:08:02 +00:00
Michael Manganiello
3f4a36a5ce feat: PostgreSQL compatibility
This change introduces PostgreSQL compatibility, by implementing the
following changes:

* Use `JSONB` instead of `JSON` for PostgreSQL databases. This is
  achieved by creating a custom `CustomJSON` type that uses `JSONB` on
  PostgreSQL and `JSON` on other databases, leveraging the variant
  mechanism of SQLAlchemy.
* Add `is_postgresql` function to check if the current database is
  PostgreSQL. Commonly used for migrations, but can be used to determine
  how to build queries based on the database engine.
* Add `json_array_contains_value` function to check if a JSON array
  includes a specific value. This function is needed as it's
  engine-specific.

Support for PostgreSQL is on a best-effort basis, and it relies on the
community for continued support and testing. The project's main database
is MariaDB.

Closes #667.
2024-12-31 12:36:33 -03:00
Michael Manganiello
b9b7a8ccda fix: Make migrations compatible with PostgreSQL
This change only verifies that Alembic can upgrade and downgrade through
all the current migrations. It does not verify that the application
works correctly with PostgreSQL.
2024-12-30 08:36:05 -03:00
Michael Manganiello
3cce2844b9 fix: Remove MySQL specific dialect from migrations
Avoid using SQLAlchemy's specific MySQL dialect in migrations.

This change also fixes migration `0014` downgrade logic, which was
broken.
2024-12-29 20:30:36 -03:00
Georges-Antoine Assi
84813bd962 Merge branch 'master' into rom-hashing-background-task 2024-12-27 12:02:04 -05:00
Michael Manganiello
d457ce077e Merge pull request #1396 from rommapp/fix/mysql-support
fix: MySQL migration and driver support
2024-12-27 11:05:55 -03:00
Michael Manganiello
a0bd575019 fix: MySQL migration and driver support
Trying to run MySQL as database (instead of MariaDB) was failing due to
incompatible migrations and lack of support for the MySQL driver.

These small changes fix the issue and recover the support for MySQL as
database driver.

Support for MySQL is on a best-effort basis, as the project's main
database is MariaDB.
2024-12-27 00:29:28 -03:00
zurdi
9645fab707 feat: Added custom name for platforms 2024-12-24 02:30:27 +00:00
Georges-Antoine Assi
bb7913ed0f fix migration file_path field 2024-12-22 13:55:54 -05:00
Georges-Antoine Assi
0850c0cbcf migration to create and move to rom_file 2024-12-20 18:09:31 -05:00
Georges-Antoine Assi
e1ef8225c3 Create migration for new romfile 2024-12-20 10:42:53 -05:00
Georges-Antoine Assi
cae4089ccf add email field 2024-12-09 19:57:13 -05:00
zurdi
5eefdda9d8 refactor aspect_ratio field to use string type and update related components 2024-12-03 10:51:29 +00:00