54 lines
2.9 KiB
Python
54 lines
2.9 KiB
Python
# Generated by Django 5.2 on 2025-05-20 09:21
|
|
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('gmail', '0009_gmailconversation_has_sent_greeting_and_more'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='ProcessedPushNotification',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('message_id', models.CharField(help_text='Pub/Sub消息ID', max_length=255, unique=True)),
|
|
('email_address', models.EmailField(help_text='通知关联的Gmail邮箱', max_length=254)),
|
|
('history_id', models.CharField(help_text='Gmail历史ID', max_length=100)),
|
|
('processed_at', models.DateTimeField(auto_now_add=True, help_text='处理时间')),
|
|
('is_successful', models.BooleanField(default=True, help_text='处理是否成功')),
|
|
('metadata', models.JSONField(blank=True, default=dict, help_text='额外信息')),
|
|
],
|
|
options={
|
|
'verbose_name': '已处理推送通知',
|
|
'verbose_name_plural': '已处理推送通知',
|
|
'db_table': 'gmail_processed_push_notifications',
|
|
'ordering': ['-processed_at'],
|
|
'indexes': [models.Index(fields=['message_id'], name='gmail_proce_message_912a0c_idx'), models.Index(fields=['email_address', 'history_id'], name='gmail_proce_email_a_2e3770_idx')],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='UnmatchedEmail',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('message_id', models.CharField(help_text='Gmail邮件ID', max_length=255, unique=True)),
|
|
('user_id', models.IntegerField(help_text='用户ID')),
|
|
('user_email', models.EmailField(help_text='用户Gmail邮箱', max_length=254)),
|
|
('from_email', models.EmailField(help_text='发件人邮箱', max_length=254)),
|
|
('to_email', models.EmailField(help_text='收件人邮箱', max_length=254)),
|
|
('subject', models.CharField(blank=True, help_text='邮件主题', max_length=500)),
|
|
('processed_at', models.DateTimeField(auto_now_add=True, help_text='处理时间')),
|
|
],
|
|
options={
|
|
'verbose_name': '未匹配邮件',
|
|
'verbose_name_plural': '未匹配邮件',
|
|
'db_table': 'gmail_unmatched_emails',
|
|
'ordering': ['-processed_at'],
|
|
'indexes': [models.Index(fields=['message_id'], name='gmail_unmat_message_c1924d_idx'), models.Index(fields=['user_id'], name='gmail_unmat_user_id_ee06fe_idx'), models.Index(fields=['user_email', 'from_email'], name='gmail_unmat_user_em_a096af_idx')],
|
|
},
|
|
),
|
|
]
|