mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
refactor: modify datasource table field type
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user