Spaces:
Sleeping
Sleeping
Download scripts/run_migrations.py from Qurrah/replyflow-rag: direct link, hf CLI and curl.
- Browser
- Download file 618 Bytes
-
https://huggingface.co/spaces/Qurrah/replyflow-rag/resolve/main/scripts/run_migrations.py
- Command line
-
hf download hf://spaces/Qurrah/replyflow-rag/scripts/run_migrations.py
-
curl -L -o run_migrations.py https://huggingface.co/spaces/Qurrah/replyflow-rag/resolve/main/scripts/run_migrations.py
618 Bytes
| import logging | |
| from peewee_migrate import Router | |
| from playhouse.db_url import connect | |
| from core.config import settings | |
| def main() -> None: | |
| logging.basicConfig(level=logging.INFO, format="%(asctime)s | %(levelname)s | %(message)s") | |
| if not settings.database_url: | |
| raise RuntimeError("database_url must be configured") | |
| database = connect(settings.database_url) | |
| router = Router(database, migrate_dir="migrations") | |
| applied = router.run() | |
| if applied: | |
| print(f"Applied: {', '.join(applied)}") | |
| else: | |
| print("Already up to date.") | |
| if __name__ == "__main__": | |
| main() | |