*: migrate from PolicyModel to PolicyBindingModel, move Policy to passbook_policies
This commit is contained in:
		@ -10,11 +10,28 @@ class Migration(migrations.Migration):
 | 
			
		||||
 | 
			
		||||
    initial = True
 | 
			
		||||
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ("passbook_core", "0011_auto_20200222_1822"),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    operations = [
 | 
			
		||||
        migrations.CreateModel(
 | 
			
		||||
            name="Policy",
 | 
			
		||||
            fields=[
 | 
			
		||||
                ("created", models.DateTimeField(auto_now_add=True)),
 | 
			
		||||
                ("last_updated", models.DateTimeField(auto_now=True)),
 | 
			
		||||
                (
 | 
			
		||||
                    "uuid",
 | 
			
		||||
                    models.UUIDField(
 | 
			
		||||
                        default=uuid.uuid4,
 | 
			
		||||
                        editable=False,
 | 
			
		||||
                        primary_key=True,
 | 
			
		||||
                        serialize=False,
 | 
			
		||||
                    ),
 | 
			
		||||
                ),
 | 
			
		||||
                ("name", models.TextField(blank=True, null=True)),
 | 
			
		||||
                ("negate", models.BooleanField(default=False)),
 | 
			
		||||
                ("order", models.IntegerField(default=0)),
 | 
			
		||||
                ("timeout", models.IntegerField(default=30)),
 | 
			
		||||
            ],
 | 
			
		||||
            options={"abstract": False,},
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.CreateModel(
 | 
			
		||||
            name="PolicyBinding",
 | 
			
		||||
            fields=[
 | 
			
		||||
@ -34,7 +51,7 @@ class Migration(migrations.Migration):
 | 
			
		||||
                    models.ForeignKey(
 | 
			
		||||
                        on_delete=django.db.models.deletion.CASCADE,
 | 
			
		||||
                        related_name="+",
 | 
			
		||||
                        to="passbook_core.Policy",
 | 
			
		||||
                        to="passbook_policies.Policy",
 | 
			
		||||
                    ),
 | 
			
		||||
                ),
 | 
			
		||||
            ],
 | 
			
		||||
@ -60,7 +77,7 @@ class Migration(migrations.Migration):
 | 
			
		||||
                    models.ManyToManyField(
 | 
			
		||||
                        related_name="_policybindingmodel_policies_+",
 | 
			
		||||
                        through="passbook_policies.PolicyBinding",
 | 
			
		||||
                        to="passbook_core.Policy",
 | 
			
		||||
                        to="passbook_policies.Policy",
 | 
			
		||||
                    ),
 | 
			
		||||
                ),
 | 
			
		||||
            ],
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
# Generated by Django 3.0.3 on 2020-05-08 16:42
 | 
			
		||||
# Generated by Django 3.0.5 on 2020-05-16 15:16
 | 
			
		||||
 | 
			
		||||
from django.db import migrations, models
 | 
			
		||||
 | 
			
		||||
@ -6,7 +6,6 @@ from django.db import migrations, models
 | 
			
		||||
class Migration(migrations.Migration):
 | 
			
		||||
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ("passbook_core", "0011_auto_20200222_1822"),
 | 
			
		||||
        ("passbook_policies", "0002_auto_20200508_1230"),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
@ -18,7 +17,7 @@ class Migration(migrations.Migration):
 | 
			
		||||
                blank=True,
 | 
			
		||||
                related_name="_policybindingmodel_policies_+",
 | 
			
		||||
                through="passbook_policies.PolicyBinding",
 | 
			
		||||
                to="passbook_core.Policy",
 | 
			
		||||
                to="passbook_policies.Policy",
 | 
			
		||||
            ),
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
		Reference in New Issue
	
	Block a user