mirror of
https://github.com/quay/quay.git
synced 2026-01-26 06:21:37 +03:00
* chore: drop deprecated tables and remove unused code * isort imports * migration: check for table existence before drop
26 lines
572 B
Python
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()
|