Skip to content

Commit 867098a

Browse files
committed
refactor: modify datasource table field type
1 parent b40eb3d commit 867098a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

backend/alembic/env.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525
# from apps.system.models.user import SQLModel # noqa
2626
# from apps.settings.models.setting_models import SQLModel
2727
# from apps.chat.models.chat_model import SQLModel
28-
from apps.terminology.models.terminology_model import SQLModel
29-
from apps.data_training.models.data_training_model import SQLModel
28+
# from apps.terminology.models.terminology_model import SQLModel
29+
# from apps.data_training.models.data_training_model import SQLModel
3030
# from apps.dashboard.models.dashboard_model import SQLModel
3131
from common.core.config import settings # noqa
32+
from apps.datasource.models.datasource import SQLModel
3233

3334
target_metadata = SQLModel.metadata
3435

backend/apps/datasource/models/datasource.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class CoreDatasource(SQLModel, table=True):
1010
__tablename__ = "core_datasource"
11-
id: int = Field(sa_column=Column(Integer, Identity(always=True), nullable=False, primary_key=True))
11+
id: int = Field(sa_column=Column(BigInteger, Identity(always=True), nullable=False, primary_key=True))
1212
name: str = Field(max_length=128, nullable=False)
1313
description: str = Field(max_length=512, nullable=True)
1414
type: str = Field(max_length=64)
@@ -23,7 +23,7 @@ class CoreDatasource(SQLModel, table=True):
2323

2424
class CoreTable(SQLModel, table=True):
2525
__tablename__ = "core_table"
26-
id: int = Field(sa_column=Column(Integer, Identity(always=True), nullable=False, primary_key=True))
26+
id: int = Field(sa_column=Column(BigInteger, Identity(always=True), nullable=False, primary_key=True))
2727
ds_id: int = Field(sa_column=Column(BigInteger()))
2828
checked: bool = Field(default=True)
2929
table_name: str = Field(sa_column=Column(Text))
@@ -33,7 +33,7 @@ class CoreTable(SQLModel, table=True):
3333

3434
class CoreField(SQLModel, table=True):
3535
__tablename__ = "core_field"
36-
id: int = Field(sa_column=Column(Integer, Identity(always=True), nullable=False, primary_key=True))
36+
id: int = Field(sa_column=Column(BigInteger, Identity(always=True), nullable=False, primary_key=True))
3737
ds_id: int = Field(sa_column=Column(BigInteger()))
3838
table_id: int = Field(sa_column=Column(BigInteger()))
3939
checked: bool = Field(default=True)

0 commit comments

Comments
 (0)