Spaces:
Sleeping
Sleeping
Download scripts/create_billing_tables.py from ChiragPatankar/RAG_backend: direct link, hf CLI and curl.
- Browser
- Download file 866 Bytes
-
https://huggingface.co/spaces/ChiragPatankar/RAG_backend/resolve/main/scripts/create_billing_tables.py
- Command line
-
hf download hf://spaces/ChiragPatankar/RAG_backend/scripts/create_billing_tables.py
-
curl -L -o create_billing_tables.py https://huggingface.co/spaces/ChiragPatankar/RAG_backend/resolve/main/scripts/create_billing_tables.py
866 Bytes
| """ | |
| Create billing database tables. | |
| Run this script to initialize the billing database. | |
| """ | |
| import sys | |
| from pathlib import Path | |
| # Add parent directory to path | |
| sys.path.insert(0, str(Path(__file__).parent.parent)) | |
| from app.db.database import init_db, engine | |
| from app.db.models import Base | |
| def main(): | |
| """Create all billing tables.""" | |
| print("Creating billing database tables...") | |
| try: | |
| # Create all tables | |
| Base.metadata.create_all(bind=engine) | |
| print("✅ Billing tables created successfully!") | |
| print("\nTables created:") | |
| print(" - tenants") | |
| print(" - tenant_plans") | |
| print(" - usage_events") | |
| print(" - usage_daily") | |
| print(" - usage_monthly") | |
| except Exception as e: | |
| print(f"❌ Error creating tables: {e}") | |
| sys.exit(1) | |
| if __name__ == "__main__": | |
| main() | |