修改app表名为默认表名
This commit is contained in:
parent
66297c4e7e
commit
f0bc011257
@ -0,0 +1,89 @@
|
||||
# Generated by Django 5.2 on 2025-05-21 04:30
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('brands', '0002_campaign_alter_activity_unique_together_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameIndex(
|
||||
model_name='brandchatsession',
|
||||
new_name='brands_bran_brand_i_d22614_idx',
|
||||
old_name='brand_chat__brand_i_83752e_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='brandchatsession',
|
||||
new_name='brands_bran_session_574261_idx',
|
||||
old_name='brand_chat__session_4bf9b0_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='brandchatsession',
|
||||
new_name='brands_bran_created_c31416_idx',
|
||||
old_name='brand_chat__created_957266_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='campaign',
|
||||
new_name='brands_camp_brand_i_51f26d_idx',
|
||||
old_name='campaigns_brand_i_c2d4bd_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='campaign',
|
||||
new_name='brands_camp_dataset_9b31e4_idx',
|
||||
old_name='campaigns_dataset_bfbb68_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='campaign',
|
||||
new_name='brands_camp_is_acti_c09fdb_idx',
|
||||
old_name='campaigns_is_acti_6c57d0_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='campaign',
|
||||
new_name='brands_camp_start_d_42e603_idx',
|
||||
old_name='campaigns_start_d_5c2c6b_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='campaign',
|
||||
new_name='brands_camp_end_dat_97d26b_idx',
|
||||
old_name='campaigns_end_dat_6aaba4_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='product',
|
||||
new_name='brands_prod_brand_i_e0821d_idx',
|
||||
old_name='products_brand_i_0d1950_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='product',
|
||||
new_name='brands_prod_dataset_c7f534_idx',
|
||||
old_name='products_dataset_faf62a_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='product',
|
||||
new_name='brands_prod_is_acti_fd82c6_idx',
|
||||
old_name='products_is_acti_cb485f_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='product',
|
||||
new_name='brands_prod_pid_452ccb_idx',
|
||||
old_name='products_pid_99aab2_idx',
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='brand',
|
||||
table=None,
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='brandchatsession',
|
||||
table=None,
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='campaign',
|
||||
table=None,
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='product',
|
||||
table=None,
|
||||
),
|
||||
]
|
@ -27,7 +27,6 @@ class Brand(models.Model):
|
||||
is_active = models.BooleanField(default=True, verbose_name='是否激活')
|
||||
|
||||
class Meta:
|
||||
db_table = 'brands'
|
||||
verbose_name = '品牌'
|
||||
verbose_name_plural = '品牌'
|
||||
|
||||
@ -66,7 +65,6 @@ class Product(models.Model):
|
||||
is_active = models.BooleanField(default=True, verbose_name='是否激活')
|
||||
|
||||
class Meta:
|
||||
db_table = 'products'
|
||||
verbose_name = '产品'
|
||||
verbose_name_plural = '产品'
|
||||
unique_together = ['brand', 'name']
|
||||
@ -127,7 +125,6 @@ class Campaign(models.Model):
|
||||
is_active = models.BooleanField(default=True, verbose_name='是否激活')
|
||||
|
||||
class Meta:
|
||||
db_table = 'campaigns'
|
||||
verbose_name = '活动'
|
||||
verbose_name_plural = '活动'
|
||||
unique_together = ['brand', 'name']
|
||||
@ -168,7 +165,6 @@ class BrandChatSession(models.Model):
|
||||
is_active = models.BooleanField(default=True, verbose_name='是否激活')
|
||||
|
||||
class Meta:
|
||||
db_table = 'brand_chat_sessions'
|
||||
verbose_name = '品牌聊天会话'
|
||||
verbose_name_plural = '品牌聊天会话'
|
||||
indexes = [
|
||||
|
@ -0,0 +1,39 @@
|
||||
# Generated by Django 5.2 on 2025-05-21 04:30
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('chat', '0003_alter_chathistory_content'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='conversationsummary',
|
||||
name='user',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='chathistory',
|
||||
new_name='chat_chathi_convers_90ca0c_idx',
|
||||
old_name='chat_histor_convers_33721a_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='chathistory',
|
||||
new_name='chat_chathi_user_id_326d36_idx',
|
||||
old_name='chat_histor_user_id_aa050a_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='chathistory',
|
||||
new_name='chat_chathi_convers_bcd094_idx',
|
||||
old_name='chat_histor_convers_89bc43_idx',
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='chathistory',
|
||||
table=None,
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='ConversationSummary',
|
||||
),
|
||||
]
|
@ -38,7 +38,6 @@ class ChatHistory(models.Model):
|
||||
is_deleted = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
db_table = 'chat_history'
|
||||
ordering = ['created_at']
|
||||
indexes = [
|
||||
models.Index(fields=['conversation_id', 'created_at']),
|
||||
@ -120,22 +119,3 @@ class ChatHistory(models.Model):
|
||||
} for kb in self.get_knowledge_bases()
|
||||
]
|
||||
}
|
||||
|
||||
class ConversationSummary(models.Model):
|
||||
"""对话总结模型"""
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='conversation_summaries')
|
||||
talent_email = models.EmailField(verbose_name='达人邮箱')
|
||||
conversation_id = models.CharField(max_length=100, verbose_name='对话ID')
|
||||
summary = models.TextField(verbose_name='对话总结')
|
||||
is_active = models.BooleanField(default=True, verbose_name='是否激活')
|
||||
created_at = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
|
||||
updated_at = models.DateTimeField(auto_now=True, verbose_name='更新时间')
|
||||
|
||||
class Meta:
|
||||
db_table = 'conversation_summaries'
|
||||
verbose_name = '对话总结'
|
||||
verbose_name_plural = '对话总结'
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.user.username}与{self.talent_email}的对话总结"
|
@ -0,0 +1,21 @@
|
||||
# Generated by Django 5.2 on 2025-05-21 04:30
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('feishu', '0003_feishutablemapping_delete_feishuauth'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelTable(
|
||||
name='feishucreator',
|
||||
table=None,
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='feishutablemapping',
|
||||
table=None,
|
||||
),
|
||||
]
|
@ -50,7 +50,6 @@ class FeishuCreator(models.Model):
|
||||
updated_at = models.DateTimeField(auto_now=True, verbose_name='更新时间')
|
||||
|
||||
class Meta:
|
||||
db_table = 'feishu_creators'
|
||||
verbose_name = '创作者数据'
|
||||
verbose_name_plural = '创作者数据'
|
||||
|
||||
@ -68,7 +67,6 @@ class FeishuTableMapping(models.Model):
|
||||
total_records = models.IntegerField(default=0, verbose_name='总记录数')
|
||||
|
||||
class Meta:
|
||||
db_table = 'feishu_table_mapping'
|
||||
verbose_name = '飞书表格映射'
|
||||
verbose_name_plural = '飞书表格映射'
|
||||
unique_together = ('app_token', 'table_id')
|
||||
|
17
apps/gmail/migrations/0012_alter_usergoal_table.py
Normal file
17
apps/gmail/migrations/0012_alter_usergoal_table.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Generated by Django 5.2 on 2025-05-21 04:22
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gmail', '0011_alter_unmatchedemail_user_id'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelTable(
|
||||
name='usergoal',
|
||||
table=None,
|
||||
),
|
||||
]
|
@ -132,7 +132,6 @@ class UserGoal(models.Model):
|
||||
metadata = models.JSONField(default=dict, blank=True, null=True, help_text="存储额外信息")
|
||||
|
||||
class Meta:
|
||||
db_table = 'user_goals'
|
||||
verbose_name = '用户目标'
|
||||
verbose_name_plural = '用户目标'
|
||||
ordering = ['-updated_at']
|
||||
|
@ -0,0 +1,51 @@
|
||||
# Generated by Django 5.2 on 2025-05-21 04:30
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('knowledge_base', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameIndex(
|
||||
model_name='knowledgebase',
|
||||
new_name='knowledge_b_type_7a8dcc_idx',
|
||||
old_name='knowledge_b_type_0439e7_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='knowledgebase',
|
||||
new_name='knowledge_b_departm_8f1cf3_idx',
|
||||
old_name='knowledge_b_departm_e739fd_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='knowledgebase',
|
||||
new_name='knowledge_b_group_ae45d4_idx',
|
||||
old_name='knowledge_b_group_3dcf34_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='knowledgebasedocument',
|
||||
new_name='knowledge_b_knowled_6653e6_idx',
|
||||
old_name='knowledge_b_knowled_a4db1b_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='knowledgebasedocument',
|
||||
new_name='knowledge_b_documen_1fd896_idx',
|
||||
old_name='knowledge_b_documen_dab90f_idx',
|
||||
),
|
||||
migrations.RenameIndex(
|
||||
model_name='knowledgebasedocument',
|
||||
new_name='knowledge_b_externa_ae1a97_idx',
|
||||
old_name='knowledge_b_externa_b0060c_idx',
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='knowledgebase',
|
||||
table=None,
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='knowledgebasedocument',
|
||||
table=None,
|
||||
),
|
||||
]
|
@ -97,7 +97,6 @@ class KnowledgeBase(models.Model):
|
||||
cls.objects.filter(id=instance_id).update(external_id=external_id)
|
||||
|
||||
class Meta:
|
||||
db_table = 'knowledge_bases'
|
||||
indexes = [
|
||||
models.Index(fields=['type']),
|
||||
models.Index(fields=['department']),
|
||||
@ -167,7 +166,6 @@ class KnowledgeBaseDocument(models.Model):
|
||||
update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间')
|
||||
|
||||
class Meta:
|
||||
db_table = 'knowledge_base_documents'
|
||||
unique_together = ['knowledge_base', 'document_id']
|
||||
indexes = [
|
||||
models.Index(fields=['knowledge_base', 'status']),
|
||||
|
@ -0,0 +1,22 @@
|
||||
# Generated by Django 5.2 on 2025-05-21 04:30
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('permissions', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameIndex(
|
||||
model_name='knowledgebasepermission',
|
||||
new_name='permissions_knowled_587239_idx',
|
||||
old_name='knowledge_b_knowled_88e81e_idx',
|
||||
),
|
||||
migrations.AlterModelTable(
|
||||
name='knowledgebasepermission',
|
||||
table=None,
|
||||
),
|
||||
]
|
@ -164,7 +164,6 @@ class KnowledgeBasePermission(models.Model):
|
||||
expires_at = models.DateTimeField(null=True, blank=True, verbose_name='过期时间')
|
||||
|
||||
class Meta:
|
||||
db_table = 'knowledge_base_permissions'
|
||||
unique_together = ['knowledge_base', 'user']
|
||||
indexes = [
|
||||
models.Index(fields=['knowledge_base', 'user', 'status']),
|
||||
|
Loading…
Reference in New Issue
Block a user