feat: model `oauth_provider_apps`

This commit is contained in:
Junyan Qin 2025-08-20 14:21:14 +08:00
parent 5f0b52c017
commit a559a60e10
No known key found for this signature in database
GPG Key ID: 22FE3AFADC710CEB
1 changed files with 24 additions and 0 deletions

View File

@ -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__ = (