diff options
author | morpheus65535 <[email protected]> | 2023-07-27 10:12:30 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2023-07-27 10:12:30 -0400 |
commit | 6f03758becabd53d71a9492eb324c245c9956636 (patch) | |
tree | 1db8813665ecbd187200e59aed18e36a27fb0d93 | |
parent | bccded275c3cb09dc001d66858f3200c78723935 (diff) | |
download | bazarr-1.2.5-beta.4.tar.gz bazarr-1.2.5-beta.4.zip |
Fixed issue with missing migrations directory in release asset.v1.2.5-beta.4
-rw-r--r-- | .github/files_to_copy | 1 | ||||
-rw-r--r-- | bazarr/app/database.py | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/.github/files_to_copy b/.github/files_to_copy index 336f93564..ed55a6ce7 100644 --- a/.github/files_to_copy +++ b/.github/files_to_copy @@ -4,3 +4,4 @@ libs bazarr.py requirements.txt postgres-requirements.txt +migrations diff --git a/bazarr/app/database.py b/bazarr/app/database.py index cb2cd7a72..2a8791b88 100644 --- a/bazarr/app/database.py +++ b/bazarr/app/database.py @@ -27,6 +27,8 @@ postgresql = (os.getenv("POSTGRES_ENABLED", settings.postgresql.enabled).lower() region = make_region().configure('dogpile.cache.memory') +migrations_directory = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'migrations') + if postgresql: # insert is different between database types from sqlalchemy.dialects.postgresql import insert # noqa E402 @@ -313,7 +315,7 @@ def create_db_revision(app): db = SQLAlchemy(app, metadata=metadata) with app.app_context(): flask_migrate.Migrate(app, db, render_as_batch=True) - flask_migrate.migrate() + flask_migrate.migrate(directory=migrations_directory) db.engine.dispose() @@ -329,7 +331,7 @@ def migrate_db(app): with app.app_context(): flask_migrate.Migrate(app, db, render_as_batch=True) - flask_migrate.upgrade() + flask_migrate.upgrade(directory=migrations_directory) db.engine.dispose() # add the system table single row if it's not existing |