mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-03 22:30:31 +08:00
Refactor: Change table chat_channel status data type. (#16061)
### What problem does this PR solve? As title. ### Type of change - [x] Refactoring
This commit is contained in:
@@ -1254,7 +1254,7 @@ class ChatChannel(DataBaseModel):
|
||||
channel = CharField(max_length=128, null=False, help_text="Chat channel type", index=True)
|
||||
config = JSONField(null=False, default={}, help_text="Channel credential & settings")
|
||||
dialog_id = CharField(max_length=32, null=True, default=None, help_text="connected dialog id", index=True)
|
||||
status = CharField(max_length=16, null=True, help_text="1: valid, 0: invalid", default="1", index=True)
|
||||
status = IntegerField(default=1, index=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -1777,6 +1777,7 @@ def migrate_db():
|
||||
alter_db_column_type(migrator, "document", "size", BigIntegerField(default=0, index=True))
|
||||
alter_db_column_type(migrator, "file", "size", BigIntegerField(default=0, index=True))
|
||||
alter_db_add_column(migrator, "tenant", "ocr_id", CharField(max_length=128, null=True, help_text="default ocr model ID", index=True))
|
||||
alter_db_column_type(migrator, "chat_channel", "status", IntegerField(default=1, index=True))
|
||||
# Drop both the explicit "idx_*" name from later migrations AND the
|
||||
# Peewee-auto-derived "<table-as-classname>_<col1>_<col2>" name from the
|
||||
# original TenantModelInstance definition (commit dc4b82523). Databases
|
||||
|
||||
@@ -54,7 +54,7 @@ class ChatChannelService(CommonService):
|
||||
@DB.connection_context()
|
||||
def list_active(cls):
|
||||
"""Return all enabled chat channel bots across tenants (with credentials)."""
|
||||
return list(cls.model.select().where(cls.model.status == "1"))
|
||||
return list(cls.model.select().where(cls.model.status == 1))
|
||||
|
||||
@classmethod
|
||||
@DB.connection_context()
|
||||
|
||||
Reference in New Issue
Block a user