Files
mtusi2026lab7/scripts/migrate.py
T
killoq 550c2e76ee
Skeleton contracts / contracts (pull_request) Blocked by required conditions
lab7
2026-12-06 15:56:06 +03:00

22 lines
495 B
Python

#!/usr/bin/env python3
"""Apply database migrations once before API replicas start."""
import logging
from pathlib import Path
import sys
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from db import Store
def main():
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s')
store = Store.connect()
try:
logging.info('database migrations are current')
finally:
store.close()
if __name__ == '__main__':
main()