feat: remove BuiltinDatasourceProvider class and related credential handling

This commit is contained in:
Harry
2025-07-18 14:47:08 +08:00
parent 82b531e949
commit ab775bce26
2 changed files with 39 additions and 35 deletions

View File

@ -0,0 +1,39 @@
"""datasource_oauth_2
Revision ID: 1bce102aef9a
Revises: d4a76fde2724
Create Date: 2025-07-18 14:46:11.392061
"""
from alembic import op
import models as models
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '1bce102aef9a'
down_revision = 'd4a76fde2724'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('tool_builtin_datasource_providers')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('tool_builtin_datasource_providers',
sa.Column('id', sa.UUID(), server_default=sa.text('uuid_generate_v4()'), autoincrement=False, nullable=False),
sa.Column('tenant_id', sa.UUID(), autoincrement=False, nullable=True),
sa.Column('user_id', sa.UUID(), autoincrement=False, nullable=False),
sa.Column('provider', sa.VARCHAR(length=256), autoincrement=False, nullable=False),
sa.Column('encrypted_credentials', sa.TEXT(), autoincrement=False, nullable=True),
sa.Column('created_at', postgresql.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP(0)'), autoincrement=False, nullable=False),
sa.Column('updated_at', postgresql.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP(0)'), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('tool_builtin_datasource_provider_pkey')),
sa.UniqueConstraint('tenant_id', 'provider', name=op.f('unique_builtin_datasource_provider'), postgresql_include=[], postgresql_nulls_not_distinct=False)
)
# ### end Alembic commands ###