Organize migrations to avoid issues with…

…migrations already applied from master.
This commit is contained in:
Aurélien Delobelle 2017-10-17 15:47:32 +02:00
parent 2c76bea1e6
commit 097ee44131
4 changed files with 56 additions and 28 deletions

View file

@ -20,31 +20,5 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)),
('token', models.CharField(unique=True, max_length=50)),
],
options={
'default_permissions': (),
},
),
migrations.CreateModel(
name='Group',
fields=[
('group_ptr', models.OneToOneField(parent_link=True, serialize=False, primary_key=True, auto_created=True, to='auth.Group')),
],
options={
'default_permissions': ('view', 'add', 'change'),
'verbose_name': 'Groupe',
'verbose_name_plural': 'Groupes',
},
bases=('auth.group',),
),
migrations.CreateModel(
name='Permission',
fields=[
],
options={
'verbose_name': 'Permission',
'verbose_name_plural': 'Permissions',
'proxy': True,
},
bases=('auth.permission',),
),
]

View file

@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('kfetauth', '0001_initial'),
]
operations = [
# See also `kfetauth.0004` migration which deletes already created
# permissions, if applicable.
migrations.AlterModelOptions(
name='genericteamtoken',
options={
'default_permissions': (),
},
),
# See also `kfetauth.0003` migration which imports existing K-Fêt
# groups.
# See also `kfetauth.0004` migration which gives the default
# permissions to `Group` objects which have the deleted
# `kfet.manage_perms` permission.
migrations.CreateModel(
name='Group',
fields=[
('group_ptr', models.OneToOneField(
parent_link=True,
serialize=False,
primary_key=True,
auto_created=True,
to='auth.Group',
)),
],
options={
'default_permissions': ('view', 'add', 'change'),
'verbose_name': 'Groupe',
'verbose_name_plural': 'Groupes',
},
bases=('auth.group',),
),
migrations.CreateModel(
name='Permission',
fields=[
],
options={
'verbose_name': 'Permission',
'verbose_name_plural': 'Permissions',
'proxy': True,
},
bases=('auth.permission',),
),
]

View file

@ -22,7 +22,7 @@ class Migration(migrations.Migration):
"""
dependencies = [
('kfetauth', '0001_initial'),
('kfetauth', '0002_create_group_permission_models'),
('auth', '0006_require_contenttypes_0002'),
]

View file

@ -70,7 +70,7 @@ class Migration(migrations.Migration):
Data migration about permissions.
"""
dependencies = [
('kfetauth', '0002_existing_groups'),
('kfetauth', '0003_existing_groups'),
('auth', '0006_require_contenttypes_0002'),
('contenttypes', '0002_remove_content_type_name'),
]