26 lines
579 B
Python
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),
|
|
]
|