19 lines
439 B
Python
19 lines
439 B
Python
"""Database configuration and initialization."""
|
|
|
|
from flask_migrate import Migrate
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
db = SQLAlchemy()
|
|
migrate = Migrate()
|
|
|
|
|
|
def init_db(app):
|
|
"""Initialize database with Flask app."""
|
|
db.init_app(app)
|
|
migrate.init_app(app, db)
|
|
|
|
# Import models here to ensure they are registered with SQLAlchemy
|
|
from app.models import sound_played, user, user_oauth # noqa: F401
|
|
|
|
return db
|