refactor: modify datasource table field type

This commit is contained in:
junjun
2025-09-22 17:15:44 +08:00
committed by Junjun
parent b40eb3d549
commit 2b220eb9e1
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -25,10 +25,11 @@ config = context.config
# 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
+3 -3
View File
@@ -8,7 +8,7 @@ from sqlmodel import SQLModel, Field
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)