From b2fb321af85756802f62284b99d7a6884d31fdd8 Mon Sep 17 00:00:00 2001 From: "naotama (Naoki KOBAYASHI)" Date: Mon, 17 Mar 2025 14:48:19 +0900 Subject: [PATCH] Corrected according to https://github.com/langgenius/dify/issues/15936#issuecomment-2727350867 --- api/commands.py | 3 +-- api/models/model.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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"))