# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-05-08 13:20 from __future__ import unicode_literals import desecapi.models import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('desecapi', '0014_ip_validation'), ] operations = [ migrations.CreateModel( name='RRset', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(null=True)), ('subname', models.CharField(blank=True, max_length=178)), ('type', models.CharField(max_length=10, validators=[desecapi.models.validate_upper])), # max_length is due to row length limit and lifted later when we switch the charset from utf8 to latin1. ('records', models.CharField(blank=True, max_length=16000)), ('ttl', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1)])), ('domain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rrsets', to='desecapi.Domain')), ], ), migrations.AlterUniqueTogether( name='rrset', unique_together=set([('domain', 'subname', 'type')]), ), # Here we extend the row length as we change the charset accordingly. We also tell Django what the new field state is. migrations.RunSQL( "ALTER TABLE desecapi_rrset MODIFY records VARCHAR(64000) CHARACTER SET latin1 NOT NULL;", state_operations=[ migrations.AlterField( model_name='rrset', name='records', field=models.CharField(blank=True, max_length=64000), ), ], ), ]