1
0
mirror of https://github.com/quay/quay.git synced 2026-01-27 18:42:52 +03:00
Files
quay/conf/init/data_migration.py
Kenny Lee Sin Cheong 5f63b3a7bb chore: drop deprecated tables and remove unused code (PROJQUAY-522) (#2089)
* chore: drop deprecated tables and remove unused code

* isort imports

* migration: check for table existence before drop
2023-08-25 12:17:24 -04:00

26 lines
572 B
Python

import os
from active_migration import ActiveDataMigration
from app import app
def current_migration():
if os.getenv("ENSURE_NO_MIGRATION", "").lower() == "true":
raise Exception("Cannot call migration when ENSURE_NO_MIGRATION is true")
if not app.config.get("SETUP_COMPLETE", False):
return "head"
else:
if ActiveDataMigration is not None:
return ActiveDataMigration.alembic_migration_revision
else:
return "head"
def main():
print(current_migration())
if __name__ == "__main__":
main()