From a559a60e10bef85a7362c6adccb131efdae57884 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Wed, 20 Aug 2025 14:21:14 +0800 Subject: [PATCH] feat: model `oauth_provider_apps` --- api/models/model.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/api/models/model.py b/api/models/model.py index c4303f3cc5..e7ddcf2d92 100644 --- a/api/models/model.py +++ b/api/models/model.py @@ -607,6 +607,30 @@ class InstalledApp(Base): return tenant +class OAuthProviderApp(Base): + """ + Globally shared OAuth provider app information. + Only for Dify Cloud. + """ + + __tablename__ = "oauth_provider_apps" + __table_args__ = ( + sa.PrimaryKeyConstraint("id", name="oauth_provider_app_pkey"), + sa.Index("oauth_provider_app_app_id_idx", "app_id"), + ) + + id = mapped_column(StringUUID, server_default=sa.text("uuid_generate_v4()")) + app_icon = mapped_column(String(255), nullable=False) + app_label = mapped_column(sa.Text, nullable=False, server_default="{}") + client_id = mapped_column(String(255), nullable=False) + client_secret = mapped_column(String(255), nullable=False) + redirect_uri = mapped_column(String(255), nullable=False) + scope = mapped_column( + String(255), nullable=False, server_default=sa.text("'name email avatar interface_language timezone'") + ) + created_at = mapped_column(sa.DateTime, nullable=False, server_default=sa.text("CURRENT_TIMESTAMP(0)")) + + class Conversation(Base): __tablename__ = "conversations" __table_args__ = (