Files

15 lines
510 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
backend/app/extensions.py
用途:Flask 扩展单例(SQLAlchemy db、Flask-Migrate migrate)的唯一定义处。
依赖:flask_sqlalchemy、flask_migrate。
逻辑:create_app 调用 db.init_app / migrate.init_app;models 与 services 通过 from app import db 或
from app.extensions import db 引用同一实例,避免在 app/__init__.py 与应用工厂混杂定义。
"""
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
db = SQLAlchemy()
migrate = Migrate()