diff --git a/api/commands.py b/api/commands.py index 0aec211a2e..f97fa86448 100644 --- a/api/commands.py +++ b/api/commands.py @@ -161,8 +161,7 @@ def migrate_annotation_vector_database(): try: # get apps info apps = ( - db.session.query(App) - .filter(App.status == "normal") + App.query.filter(App.status == "normal") .order_by(App.created_at.desc()) .paginate(page=page, per_page=50) ) diff --git a/api/models/model.py b/api/models/model.py index bf212e8036..efe4e98c47 100644 --- a/api/models/model.py +++ b/api/models/model.py @@ -74,7 +74,7 @@ class IconType(Enum): EMOJI = "emoji" -class App(Base): +class App(db.Model): # type: ignore[name-defined] __tablename__ = "apps" __table_args__ = (db.PrimaryKeyConstraint("id", name="app_pkey"), db.Index("app_tenant_id_idx", "tenant_id"))