Commit 50740229 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Start over with the migrations

With all those strange changes, the migrations were broken. I removed
all of them and started with new migrations.

For django-polymorphic i had to rename the Model 'bases' in the auto
generated migrations, as the seem to be case sensitive.
parent 8193af5b
# Generated by Django 2.1 on 2018-08-06 09:29 # Generated by Django 2.1.3 on 2018-12-05 14:24
from django.conf import settings from django.conf import settings
import django.contrib.auth.models import django.contrib.auth.models
...@@ -8,8 +8,8 @@ import django.db.models.deletion ...@@ -8,8 +8,8 @@ import django.db.models.deletion
import django.utils.timezone import django.utils.timezone
import django_mysql.models import django_mysql.models
import feudal.backend.auth.v1.models import feudal.backend.auth.v1.models
import feudal.backend.models
import feudal.backend.models.brokers import feudal.backend.models.brokers
import feudal.backend.models.deployments
import feudal.backend.models.users import feudal.backend.models.users
...@@ -19,6 +19,7 @@ class Migration(migrations.Migration): ...@@ -19,6 +19,7 @@ class Migration(migrations.Migration):
dependencies = [ dependencies = [
('auth', '0009_alter_user_last_name_max_length'), ('auth', '0009_alter_user_last_name_max_length'),
('contenttypes', '0002_remove_content_type_name'),
] ]
operations = [ operations = [
...@@ -40,42 +41,52 @@ class Migration(migrations.Migration): ...@@ -40,42 +41,52 @@ class Migration(migrations.Migration):
('password', models.CharField(blank=True, max_length=150, null=True)), ('password', models.CharField(blank=True, max_length=150, null=True)),
('_is_active', models.BooleanField(default=True, editable=False)), ('_is_active', models.BooleanField(default=True, editable=False)),
('userinfo', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.users.user_info_default, editable=False, null=True)), ('userinfo', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.users.user_info_default, editable=False, null=True)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
], ],
options={ options={
'verbose_name': 'user', 'verbose_name': 'user',
'abstract': False,
'verbose_name_plural': 'users', 'verbose_name_plural': 'users',
'abstract': False,
}, },
managers=[ managers=[
('objects', django.contrib.auth.models.UserManager()), ('objects', django.contrib.auth.models.UserManager()),
], ],
), ),
migrations.CreateModel(
name='CredentialState',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('state_target', models.CharField(choices=[('deployed', 'Deployed'), ('not_deployed', 'Not Deployed')], default='not_deployed', max_length=50)),
('state', models.CharField(choices=[('deployment_pending', 'VODeployment Pending'), ('removal_pending', 'Removal Pending'), ('deployed', 'Deployed'), ('not_deployed', 'Not Deployed'), ('questionnaire', 'Questionnaire'), ('failed', 'Failed'), ('rejected', 'Rejected')], default='not_deployed', max_length=50)),
('_credential_deleted', models.BooleanField(default=False)),
],
),
migrations.CreateModel( migrations.CreateModel(
name='Deployment', name='Deployment',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('state_target', models.CharField(choices=[('deployed', 'Deployed'), ('not_deployed', 'Not Deployed')], default='not_deployed', max_length=50)),
('is_active', models.BooleanField(default=True)), ('is_active', models.BooleanField(default=True)),
('group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='deployments', to='auth.Group')),
], ],
options={
'base_manager_name': 'objects',
'abstract': False,
},
), ),
migrations.CreateModel( migrations.CreateModel(
name='DeploymentState', name='DeploymentState',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('state_target', models.CharField(choices=[('deployment_pending', 'Deployment Pending'), ('removal_pending', 'Removal Pending'), ('deployed', 'Deployed'), ('not_deployed', 'Not Deployed'), ('questionnaire', 'Questionnaire'), ('failed', 'Failed'), ('rejected', 'Rejected')], default='deployed', max_length=50)), ('state', models.CharField(choices=[('deployment_pending', 'VODeployment Pending'), ('removal_pending', 'Removal Pending'), ('deployed', 'Deployed'), ('not_deployed', 'Not Deployed'), ('questionnaire', 'Questionnaire'), ('failed', 'Failed'), ('rejected', 'Rejected')], default='not_deployed', max_length=50)),
('deployment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='states', to='backend.Deployment')), ('message', models.TextField(default='', max_length=300)),
('questionnaire', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.deployments.questionnaire_default, null=True)),
('credentials', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.deployments.credential_default, null=True)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='DeploymentStateItem', name='EntitlementNameSpace',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('state', models.CharField(choices=[('deployment_pending', 'Deployment Pending'), ('removal_pending', 'Removal Pending'), ('deployed', 'Deployed'), ('not_deployed', 'Not Deployed'), ('questionnaire', 'Questionnaire'), ('failed', 'Failed'), ('rejected', 'Rejected')], default='deployment_pending', max_length=50)), ('name', models.CharField(max_length=200, unique=True)),
('message', models.TextField(default='', max_length=300)),
('questionnaire', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.questionnaire_default, null=True)),
('credentials', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.credential_default, null=True)),
('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='state_items', to='backend.DeploymentState')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -84,11 +95,13 @@ class Migration(migrations.Migration): ...@@ -84,11 +95,13 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('client_id', models.CharField(max_length=200)), ('client_id', models.CharField(max_length=200)),
('client_secret', models.CharField(max_length=200)), ('client_secret', models.CharField(max_length=200)),
('redirect_uri', models.CharField(max_length=200)),
('issuer_uri', models.CharField(max_length=200)), ('issuer_uri', models.CharField(max_length=200)),
('enabled', models.BooleanField(default=False)), ('enabled', models.BooleanField(default=False)),
('name', models.CharField(max_length=200)), ('name', models.CharField(max_length=200)),
('scopes', django_mysql.models.JSONField(default=feudal.backend.auth.v1.models.scopes_default)), ('redirect_uri', models.CharField(default='https://<domain>/backend/auth/v1/callback', max_length=200)),
('scopes', django_mysql.models.JSONField(default=feudal.backend.auth.v1.models.scopes_default, help_text='The scopes we use when requesting user infos')),
('userinfo_field_groups', models.CharField(blank=True, default='', help_text="The field in the userinfo (served by this IdP) that contains groups of the user.\n Leave blank if you don't want to use groups of this IdP", max_length=200)),
('userinfo_field_entitlements', models.CharField(blank=True, default='', help_text="The field in the userinfo (served by this IdP) that contains entitlements of the user.\n Leave blank if you don't want to use entitlements of this IdP", max_length=200)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -96,7 +109,7 @@ class Migration(migrations.Migration): ...@@ -96,7 +109,7 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('host', models.CharField(default='localhost', max_length=150)), ('host', models.CharField(default='localhost', max_length=150)),
('vhost', models.CharField(default='%2f', max_length=150)), ('vhost', models.CharField(default='/', max_length=150)),
('exchanges', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.brokers.exchanges_default, null=True)), ('exchanges', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.brokers.exchanges_default, null=True)),
('port', models.IntegerField(default=15672)), ('port', models.IntegerField(default=15672)),
('username', models.CharField(default='guest', max_length=150)), ('username', models.CharField(default='guest', max_length=150)),
...@@ -112,7 +125,6 @@ class Migration(migrations.Migration): ...@@ -112,7 +125,6 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=150, unique=True)), ('name', models.CharField(max_length=150, unique=True)),
('description', models.TextField(blank=True, max_length=300)), ('description', models.TextField(blank=True, max_length=300)),
('groups', models.ManyToManyField(blank=True, related_name='services', to='auth.Group')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -134,41 +146,131 @@ class Migration(migrations.Migration): ...@@ -134,41 +146,131 @@ class Migration(migrations.Migration):
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='_ssh_keys', to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='_ssh_keys', to=settings.AUTH_USER_MODEL)),
], ],
), ),
migrations.CreateModel(
name='VO',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200, unique=True)),
('description', models.TextField(blank=True, max_length=1000, null=True)),
],
options={
'base_manager_name': 'objects',
'abstract': False,
},
),
migrations.CreateModel(
name='Entitlement',
fields=[
('vo_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='backend.VO')),
('full_name', models.CharField(max_length=200)),
('group_authority', models.CharField(blank=True, max_length=200, null=True)),
('role', models.CharField(blank=True, max_length=200, null=True)),
('name_space', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='entitlements', to='backend.EntitlementNameSpace')),
],
options={
'base_manager_name': 'objects',
'abstract': False,
},
bases=('backend.VO',),
),
migrations.CreateModel(
name='Group',
fields=[
('vo_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='backend.VO')),
],
options={
'base_manager_name': 'objects',
'abstract': False,
},
bases=('backend.VO',),
),
migrations.CreateModel(
name='ServiceDeployment',
fields=[
('deployment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='backend.Deployment')),
],
options={
'base_manager_name': 'objects',
'abstract': False,
},
bases=('backend.Deployment',),
),
migrations.CreateModel(
name='VODeployment',
fields=[
('deployment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='backend.Deployment')),
],
options={
'base_manager_name': 'objects',
'abstract': False,
},
bases=('backend.Deployment',),
),
migrations.AddField( migrations.AddField(
model_name='service', model_name='vo',
name='site', name='idp',
field=models.ManyToManyField(related_name='services', to='backend.Site'), field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='vos', to='backend.OIDCConfig'),
), ),
migrations.AddField( migrations.AddField(
model_name='deploymentstateitem', model_name='vo',
name='service', name='polymorphic_ctype',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='state_items', to='backend.Service'), field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_backend.vo_set+', to='contenttypes.ContentType'),
), ),
migrations.AddField( migrations.AddField(
model_name='deploymentstateitem', model_name='service',
name='site', name='site',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='state_items', to='backend.Site'), field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='services', to='backend.Site'),
),
migrations.AddField(
model_name='service',
name='vos',
field=models.ManyToManyField(blank=True, related_name='services', to='backend.VO'),
), ),
migrations.AddField( migrations.AddField(
model_name='deploymentstate', model_name='deploymentstate',
name='key', name='deployments',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='states', to='backend.SSHPublicKey'), field=models.ManyToManyField(related_name='states', to='backend.Deployment'),
), ),
migrations.AddField( migrations.AddField(
model_name='deployment', model_name='deploymentstate',
name='service', name='service',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='deployments', to='backend.Service'), field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='states', to='backend.Service'),
),
migrations.AddField(
model_name='deploymentstate',
name='site',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='states', to='backend.Site'),
),
migrations.AddField(
model_name='deploymentstate',
name='user',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='states', to=settings.AUTH_USER_MODEL),
), ),
migrations.AddField( migrations.AddField(
model_name='deployment', model_name='deployment',
name='ssh_keys', name='polymorphic_ctype',
field=models.ManyToManyField(blank=True, related_name='deployments', to='backend.SSHPublicKey'), field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_backend.deployment_set+', to='contenttypes.ContentType'),
), ),
migrations.AddField( migrations.AddField(
model_name='deployment', model_name='deployment',
name='user', name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='deployments', to=settings.AUTH_USER_MODEL), field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='deployments', to=settings.AUTH_USER_MODEL),
), ),
migrations.AddField(
model_name='credentialstate',
name='credential',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credential_states', to='backend.SSHPublicKey'),
),
migrations.AddField(
model_name='credentialstate',
name='target',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credential_states', to='backend.DeploymentState'),
),
migrations.AddField(
model_name='user',
name='groups',
field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
),
migrations.AddField( migrations.AddField(
model_name='user', model_name='user',
name='idp', name='idp',
...@@ -179,4 +281,19 @@ class Migration(migrations.Migration): ...@@ -179,4 +281,19 @@ class Migration(migrations.Migration):
name='user_permissions', name='user_permissions',
field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'), field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
), ),
migrations.AddField(
model_name='user',
name='vos',
field=models.ManyToManyField(blank=True, to='backend.VO'),
),
migrations.AddField(
model_name='vodeployment',
name='vo',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vo_deployments', to='backend.VO'),
),
migrations.AddField(
model_name='servicedeployment',
name='service',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='service_deployments', to='backend.Service'),
),
] ]
# Generated by Django 2.1 on 2018-08-06 09:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='user_type',
field=models.CharField(choices=[('apiclient', 'API-Client'), ('oidcuser', 'OIDC User'), ('admin', 'Admin')], max_length=20),
),
]
# Generated by Django 2.1 on 2018-08-09 12:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0002_auto_20180806_0941'),
]
operations = [
migrations.AlterField(
model_name='user',
name='user_type',
field=models.CharField(choices=[('apiclient', 'API-Client'), ('oidcuser', 'OIDC User'), ('admin', 'Admin')], default='apiclient', max_length=20),
),
]
# Generated by Django 2.1 on 2018-08-09 14:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
('backend', '0003_auto_20180809_1209'),
]
operations = [
migrations.CreateModel(
name='NewDeployment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('state_target', models.CharField(choices=[('deployment_pending', 'Deployment Pending'), ('removal_pending', 'Removal Pending'), ('deployed', 'Deployed'), ('not_deployed', 'Not Deployed'), ('questionnaire', 'Questionnaire'), ('failed', 'Failed'), ('rejected', 'Rejected')], default='deployed', max_length=50)),
('is_active', models.BooleanField(default=True)),
('group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='deployments', to='auth.Group')),
('service', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='deployments', to='backend.Service')),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='deployments', to=settings.AUTH_USER_MODEL)),
],
),
migrations.RemoveField(
model_name='deployment',
name='group',
),
migrations.RemoveField(
model_name='deployment',
name='service',
),
migrations.RemoveField(
model_name='deployment',
name='ssh_keys',
),
migrations.RemoveField(
model_name='deployment',
name='user',
),
migrations.RemoveField(
model_name='deploymentstate',
name='deployment',
),
migrations.RemoveField(
model_name='deploymentstate',
name='key',
),
migrations.AlterField(
model_name='deploymentstateitem',
name='parent',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='state_items', to='backend.NewDeployment'),
),
migrations.AlterField(
model_name='rabbitmqinstance',
name='vhost',
field=models.CharField(default='/', max_length=150),
),
migrations.DeleteModel(
name='Deployment',
),
migrations.DeleteModel(
name='DeploymentState',
),
]
# Generated by Django 2.1 on 2018-08-09 14:59
from django.db import migrations, models
import django.db.models.deletion
import django_mysql.models
import feudal.backend.models
class Migration(migrations.Migration):
dependencies = [
('backend', '0004_auto_20180809_1655'),
]
operations = [
migrations.CreateModel(
name='NewDeploymentStateItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('state', models.CharField(choices=[('deployment_pending', 'Deployment Pending'), ('removal_pending', 'Removal Pending'), ('deployed', 'Deployed'), ('not_deployed', 'Not Deployed'), ('questionnaire', 'Questionnaire'), ('failed', 'Failed'), ('rejected', 'Rejected')], default='deployment_pending', max_length=50)),
('message', models.TextField(default='', max_length=300)),
('questionnaire', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.questionnaire_default, null=True)),
('credentials', django_mysql.models.JSONField(blank=True, default=feudal.backend.models.credential_default, null=True)),
('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='state_items', to='backend.NewDeployment')),
('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='state_items', to='backend.Service')),
('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='state_items', to='backend.Site')),
],
),
migrations.RemoveField(
model_name='deploymentstateitem',
name='parent',
),
migrations.RemoveField(
model_name='deploymentstateitem',
name='service',
),
migrations.RemoveField(
model_name='deploymentstateitem',
name='site',
),
migrations.DeleteModel(
name='DeploymentStateItem',
),
]
# Generated by Django 2.1 on 2018-08-13 12:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0005_auto_20180809_1659'),
]
operations = [
migrations.AlterField(
model_name='newdeployment',
name='state_target',
field=models.CharField(choices=[('deployment_pending', 'Deployment Pending'), ('removal_pending', 'Removal Pending'), ('deployed', 'Deployed'), ('not_deployed', 'Not Deployed'), ('questionnaire', 'Questionnaire'), ('failed', 'Failed'), ('rejected', 'Rejected')], default='not_deployed', max_length=50),
),
migrations.AlterField(
model_name='newdeploymentstateitem',
name='state',
field=models.CharField(choices=[('deployment_pending', 'Deployment Pending'), ('removal_pending', 'Removal Pending'), ('deployed', 'Deployed'), ('not_deployed', 'Not Deployed'), ('questionnaire', 'Questionnaire'), ('failed', 'Failed'), ('rejected', 'Rejected')], default='not_deployed', max_length=50),
),
]
# Generated by Django 2.1 on 2018-08-21 09:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
('backend', '0006_auto_20180813_1417'),
]
operations = [
migrations.CreateModel(
name='GroupDescription',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('description', models.TextField(max_length=1000)),
('Group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='description', to='auth.Group')),
],
),
]
# Generated by Django 2.1 on 2018-08-21 09:40