authentik.crypto.migrations.0001_initial

 1# Generated by Django 3.0.6 on 2020-05-19 22:08
 2
 3import uuid
 4
 5from django.db import migrations, models
 6
 7
 8class Migration(migrations.Migration):
 9    initial = True
10
11    dependencies = []
12
13    operations = [
14        migrations.CreateModel(
15            name="CertificateKeyPair",
16            fields=[
17                ("created", models.DateTimeField(auto_now_add=True)),
18                ("last_updated", models.DateTimeField(auto_now=True)),
19                (
20                    "kp_uuid",
21                    models.UUIDField(
22                        default=uuid.uuid4,
23                        editable=False,
24                        primary_key=True,
25                        serialize=False,
26                    ),
27                ),
28                ("name", models.TextField()),
29                (
30                    "certificate_data",
31                    models.TextField(help_text="PEM-encoded Certificate data"),
32                ),
33                (
34                    "key_data",
35                    models.TextField(
36                        blank=True,
37                        default="",
38                        help_text=(
39                            "Optional Private Key. If this is set, you can use this keypair for"
40                            " encryption."
41                        ),
42                    ),
43                ),
44            ],
45            options={
46                "verbose_name": "Certificate-Key Pair",
47                "verbose_name_plural": "Certificate-Key Pairs",
48            },
49        ),
50    ]
class Migration(django.db.migrations.migration.Migration):
 9class Migration(migrations.Migration):
10    initial = True
11
12    dependencies = []
13
14    operations = [
15        migrations.CreateModel(
16            name="CertificateKeyPair",
17            fields=[
18                ("created", models.DateTimeField(auto_now_add=True)),
19                ("last_updated", models.DateTimeField(auto_now=True)),
20                (
21                    "kp_uuid",
22                    models.UUIDField(
23                        default=uuid.uuid4,
24                        editable=False,
25                        primary_key=True,
26                        serialize=False,
27                    ),
28                ),
29                ("name", models.TextField()),
30                (
31                    "certificate_data",
32                    models.TextField(help_text="PEM-encoded Certificate data"),
33                ),
34                (
35                    "key_data",
36                    models.TextField(
37                        blank=True,
38                        default="",
39                        help_text=(
40                            "Optional Private Key. If this is set, you can use this keypair for"
41                            " encryption."
42                        ),
43                    ),
44                ),
45            ],
46            options={
47                "verbose_name": "Certificate-Key Pair",
48                "verbose_name_plural": "Certificate-Key Pairs",
49            },
50        ),
51    ]

The base class for all migrations.

Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the following attributes:

  • operations: A list of Operation instances, probably from django.db.migrations.operations
  • dependencies: A list of tuples of (app_path, migration_name)
  • run_before: A list of tuples of (app_path, migration_name)
  • replaces: A list of migration_names

Note that all migrations come out of migrations and into the Loader or Graph as instances, having been initialized with their app label and name.

initial = True
dependencies = []
operations = [<CreateModel name='CertificateKeyPair', fields=[('created', <django.db.models.fields.DateTimeField>), ('last_updated', <django.db.models.fields.DateTimeField>), ('kp_uuid', <django.db.models.fields.UUIDField>), ('name', <django.db.models.fields.TextField>), ('certificate_data', <django.db.models.fields.TextField>), ('key_data', <django.db.models.fields.TextField>)], options={'verbose_name': 'Certificate-Key Pair', 'verbose_name_plural': 'Certificate-Key Pairs'}>]