From 867098adca5a320c6f672f372f56f1370f7e3202 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 22 Sep 2025 17:13:56 +0800 Subject: [PATCH] refactor: modify datasource table field type --- backend/alembic/env.py | 5 +++-- backend/apps/datasource/models/datasource.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/alembic/env.py b/backend/alembic/env.py index a5512710a..03f66af98 100755 --- a/backend/alembic/env.py +++ b/backend/alembic/env.py @@ -25,10 +25,11 @@ # from apps.system.models.user import SQLModel # noqa # from apps.settings.models.setting_models import SQLModel # from apps.chat.models.chat_model import SQLModel -from apps.terminology.models.terminology_model import SQLModel -from apps.data_training.models.data_training_model import SQLModel +# from apps.terminology.models.terminology_model import SQLModel +# from apps.data_training.models.data_training_model import SQLModel # from apps.dashboard.models.dashboard_model import SQLModel from common.core.config import settings # noqa +from apps.datasource.models.datasource import SQLModel target_metadata = SQLModel.metadata diff --git a/backend/apps/datasource/models/datasource.py b/backend/apps/datasource/models/datasource.py index 6496a857d..56814c5c6 100644 --- a/backend/apps/datasource/models/datasource.py +++ b/backend/apps/datasource/models/datasource.py @@ -8,7 +8,7 @@ class CoreDatasource(SQLModel, table=True): __tablename__ = "core_datasource" - id: int = Field(sa_column=Column(Integer, Identity(always=True), nullable=False, primary_key=True)) + id: int = Field(sa_column=Column(BigInteger, Identity(always=True), nullable=False, primary_key=True)) name: str = Field(max_length=128, nullable=False) description: str = Field(max_length=512, nullable=True) type: str = Field(max_length=64) @@ -23,7 +23,7 @@ class CoreDatasource(SQLModel, table=True): class CoreTable(SQLModel, table=True): __tablename__ = "core_table" - id: int = Field(sa_column=Column(Integer, Identity(always=True), nullable=False, primary_key=True)) + id: int = Field(sa_column=Column(BigInteger, Identity(always=True), nullable=False, primary_key=True)) ds_id: int = Field(sa_column=Column(BigInteger())) checked: bool = Field(default=True) table_name: str = Field(sa_column=Column(Text)) @@ -33,7 +33,7 @@ class CoreTable(SQLModel, table=True): class CoreField(SQLModel, table=True): __tablename__ = "core_field" - id: int = Field(sa_column=Column(Integer, Identity(always=True), nullable=False, primary_key=True)) + id: int = Field(sa_column=Column(BigInteger, Identity(always=True), nullable=False, primary_key=True)) ds_id: int = Field(sa_column=Column(BigInteger())) table_id: int = Field(sa_column=Column(BigInteger())) checked: bool = Field(default=True)