Skip to content

Commit d173c24

Browse files
committed
[migrations] Squashed 0001 and 0002 to avoid postgres error
1 parent 298b2a2 commit d173c24

File tree

2 files changed

+17
-38
lines changed

2 files changed

+17
-38
lines changed

openwisp_controller/config/migrations/0001_initial.py renamed to openwisp_controller/config/migrations/0001_squashed_0002_config_settings_uuid.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.10.5 on 2017-03-07 17:49
2+
# Generated by Django 1.10.5 on 2017-05-03 17:54
33
from __future__ import unicode_literals
44

5-
import re
6-
import uuid
7-
85
import django.core.validators
6+
from django.db import migrations, models
97
import django.db.models.deletion
108
import django.utils.timezone
9+
import django_netjsonconfig.base.template
10+
import django_netjsonconfig.utils
1111
import jsonfield.fields
1212
import model_utils.fields
13+
import re
1314
import sortedm2m.fields
14-
from django.db import migrations, models
15-
16-
import django_netjsonconfig.base.config
17-
import django_netjsonconfig.base.template
15+
import uuid
1816

1917

2018
class Migration(migrations.Migration):
2119

20+
replaces = [('config', '0001_initial'), ('config', '0002_config_settings_uuid')]
21+
2222
initial = True
2323

2424
dependencies = [
25-
('openwisp_users', '0001_initial'),
2625
('pki', '0001_initial'),
26+
('openwisp_users', '0001_initial'),
2727
]
2828

2929
operations = [
@@ -37,28 +37,28 @@ class Migration(migrations.Migration):
3737
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
3838
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
3939
('status', model_utils.fields.StatusField(choices=[('modified', 'modified'), ('running', 'running'), ('error', 'error')], default='modified', help_text='modified means the configuration is not applied yet; running means applied and running; error means the configuration caused issues and it was rolledback', max_length=100, no_check_for_status=True)),
40-
('key', models.CharField(db_index=True, default=django_netjsonconfig.base.config.get_random_key, help_text='unique key that can be used to download the configuration', max_length=64, unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[^\\s/\\.]+$', 32), code='invalid', message='Key must not contain spaces, dots or slashes.')])),
40+
('key', models.CharField(db_index=True, default=django_netjsonconfig.utils.get_random_key, help_text='unique key that can be used to download the configuration', max_length=64, unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[^\\s/\\.]+$', 32), code='invalid', message='Key must not contain spaces, dots or slashes.')])),
4141
('mac_address', models.CharField(help_text='primary mac address', max_length=17, unique=True, validators=[django.core.validators.RegexValidator(re.compile('^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})', 32), code='invalid', message='Must be a valid mac address.')])),
4242
('last_ip', models.GenericIPAddressField(blank=True, help_text='indicates the last ip from which the configuration was downloaded from (except downloads from this page)', null=True)),
4343
('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='openwisp_users.Organization', verbose_name='organization')),
4444
],
4545
options={
46-
'verbose_name_plural': 'configurations',
4746
'verbose_name': 'configuration',
47+
'verbose_name_plural': 'configurations',
4848
'abstract': False,
4949
},
5050
),
5151
migrations.CreateModel(
5252
name='OrganizationConfigSettings',
5353
fields=[
54-
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
54+
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
5555
('registration_enabled', models.BooleanField(default=True, help_text='Whether automatic registration of devices is enabled or not', verbose_name='auto-registration enabled')),
56-
('shared_secret', models.CharField(db_index=True, default=django_netjsonconfig.base.config.get_random_key, help_text='used for automatic registration of devices', max_length=32, unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[^\\s/\\.]+$', 32), code='invalid', message='Key must not contain spaces, dots or slashes.')], verbose_name='shared secret')),
56+
('shared_secret', models.CharField(db_index=True, default=django_netjsonconfig.utils.get_random_key, help_text='used for automatic registration of devices', max_length=32, unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[^\\s/\\.]+$', 32), code='invalid', message='Key must not contain spaces, dots or slashes.')], verbose_name='shared secret')),
5757
('organization', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='config_settings', to='openwisp_users.Organization', verbose_name='organization')),
5858
],
5959
options={
60-
'verbose_name_plural': 'Configuration management settings',
6160
'verbose_name': 'Configuration management settings',
61+
'verbose_name_plural': 'Configuration management settings',
6262
},
6363
),
6464
migrations.CreateModel(
@@ -76,8 +76,8 @@ class Migration(migrations.Migration):
7676
('organization', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='openwisp_users.Organization', verbose_name='organization')),
7777
],
7878
options={
79-
'verbose_name_plural': 'templates',
8079
'verbose_name': 'template',
80+
'verbose_name_plural': 'templates',
8181
'abstract': False,
8282
},
8383
),
@@ -98,8 +98,8 @@ class Migration(migrations.Migration):
9898
('organization', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='openwisp_users.Organization', verbose_name='organization')),
9999
],
100100
options={
101-
'verbose_name_plural': 'VPN servers',
102101
'verbose_name': 'VPN server',
102+
'verbose_name_plural': 'VPN servers',
103103
'abstract': False,
104104
},
105105
),
@@ -113,8 +113,8 @@ class Migration(migrations.Migration):
113113
('vpn', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='config.Vpn')),
114114
],
115115
options={
116-
'verbose_name_plural': 'VPN clients',
117116
'verbose_name': 'VPN client',
117+
'verbose_name_plural': 'VPN clients',
118118
'abstract': False,
119119
},
120120
),

openwisp_controller/config/migrations/0002_config_settings_uuid.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)