lty/qy_lty/aiapp/migrations/0003_create_rtc_bot.py
pmc 59b178f8f4 feat: update AI app views/urls and add RTC bot migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 11:55:52 +08:00

26 lines
579 B
Python

from django.db import migrations
def create_rtc_bot(apps, schema_editor):
Bot = apps.get_model('aiapp', 'Bot')
Bot.objects.get_or_create(
name='RTC_Voice_Agent',
defaults={'description': 'RTC实时语音智能体'}
)
def remove_rtc_bot(apps, schema_editor):
Bot = apps.get_model('aiapp', 'Bot')
Bot.objects.filter(name='RTC_Voice_Agent').delete()
class Migration(migrations.Migration):
dependencies = [
('aiapp', '0002_initial'),
]
operations = [
migrations.RunPython(create_rtc_bot, remove_rtc_bot),
]