Initial fork from theme-song-booth
This commit is contained in:
commit
99855b1212
33 changed files with 5723 additions and 0 deletions
25
init_db.py
Normal file
25
init_db.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
"""
|
||||
init_db.py
|
||||
==========
|
||||
Standalone script to create the SQLite database tables.
|
||||
|
||||
Run this once inside the container after deployment:
|
||||
python init_db.py
|
||||
|
||||
Or use the registered Flask CLI command:
|
||||
flask --app app init-db
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Ensure the project root is on sys.path so `from app import app` works.
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from app import app
|
||||
from models import init_db
|
||||
|
||||
# Use the configured database path and create tables.
|
||||
with app.app_context():
|
||||
init_db()
|
||||
print(f"Database initialized at {app.config['DATABASE']}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue