Download init_db.py from ChiragPatankar/Gemini_MCP_Server: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/ChiragPatankar/Gemini_MCP_Server/resolve/main/init_db.py
- Command line
-
hf download hf://spaces/ChiragPatankar/Gemini_MCP_Server/init_db.py
-
curl -L -o init_db.py https://huggingface.co/spaces/ChiragPatankar/Gemini_MCP_Server/resolve/main/init_db.py
1.05 kB
| #!/usr/bin/env python3 | |
| """ | |
| Database initialization script for Gemini MCP Server | |
| Run this script to create all database tables | |
| """ | |
| from database import engine, Base | |
| from models import ChatMessage, User, Tenant | |
| import os | |
| def init_database(): | |
| """Initialize the database with all tables""" | |
| print("๐ Initializing database...") | |
| try: | |
| # Create all tables | |
| Base.metadata.create_all(bind=engine) | |
| print("โ Database tables created successfully!") | |
| # Show created tables | |
| print("\n๐ Created tables:") | |
| for table_name in Base.metadata.tables.keys(): | |
| print(f" - {table_name}") | |
| print(f"\n๐พ Database location: {os.getenv('DATABASE_URL', 'sqlite:///./mcp_server.db')}") | |
| print("๐ Database initialization complete!") | |
| except Exception as e: | |
| print(f"โ Error initializing database: {str(e)}") | |
| return False | |
| return True | |
| if __name__ == "__main__": | |
| init_database() |