34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
# Generated by Django 3.2.7 on 2023-02-14 04:54
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
def add_default_orchestration(apps, schema_editor):
|
|
m = apps.get_model('library', 'Orchestration').objects
|
|
m.create(pk=1, name="Custom", instruments="")
|
|
|
|
|
|
def remove_default_orchestration(apps, schema_editor):
|
|
m = apps.get_model('library', 'Orchestration').objects
|
|
m.filter(pk=1).delete()
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('interface', '0004_auto_20230210_0938'),
|
|
('library', '0006_auto_20230202_0804'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Orchestration',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=100)),
|
|
('instruments', models.TextField()),
|
|
('ensemble', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orchestrations', to='interface.ensemble')),
|
|
],
|
|
),
|
|
migrations.RunPython(add_default_orchestration, remove_default_orchestration),
|
|
]
|