diff --git a/rootfs/api/migrations/0001_initial.py b/rootfs/api/migrations/0001_initial.py index 2aaad50b..88a96256 100644 --- a/rootfs/api/migrations/0001_initial.py +++ b/rootfs/api/migrations/0001_initial.py @@ -1,14 +1,21 @@ -# -*- coding: utf-8 -*- +# Generated by Django 2.2.24 on 2021-10-14 02:43 -from django.db import models, migrations -import jsonfield.fields import api.models -import api.fields +import api.models.app +import api.models.certificate +import api.models.key from django.conf import settings +import django.contrib.postgres.fields +from django.db import migrations, models +import django.db.models.deletion +import jsonfield.fields +import uuid class Migration(migrations.Migration): + initial = True + dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] @@ -17,185 +24,189 @@ class Migration(migrations.Migration): migrations.CreateModel( name='App', fields=[ - ('uuid', api.fields.UuidField(auto_created=True, primary_key=True, serialize=False, editable=False, max_length=32, unique=True, verbose_name='UUID')), + ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('id', models.SlugField(max_length=24, unique=True, null=True, validators=[api.models.validate_app_id, api.models.validate_reserved_names])), - ('structure', jsonfield.fields.JSONField(default={}, blank=True, validators=[api.models.validate_app_structure])), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('id', models.SlugField(max_length=63, null=True, unique=True, validators=[api.models.app.validate_app_id, api.models.app.validate_reserved_names])), + ('structure', jsonfield.fields.JSONField(blank=True, default={}, validators=[api.models.app.validate_app_structure])), + ('procfile_structure', jsonfield.fields.JSONField(blank=True, default={}, validators=[api.models.app.validate_app_structure])), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ + 'verbose_name': 'Application', + 'ordering': ['id'], 'permissions': (('use_app', 'Can use app'),), }, - bases=(models.Model,), ), migrations.CreateModel( name='Build', fields=[ - ('uuid', api.fields.UuidField(auto_created=True, primary_key=True, serialize=False, editable=False, max_length=32, unique=True, verbose_name='UUID')), + ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('image', models.CharField(max_length=256)), - ('sha', models.CharField(max_length=40, blank=True)), - ('procfile', jsonfield.fields.JSONField(default={}, blank=True)), + ('image', models.TextField()), + ('sha', models.CharField(blank=True, max_length=40)), + ('procfile', jsonfield.fields.JSONField(blank=True, default={})), ('dockerfile', models.TextField(blank=True)), - ('app', models.ForeignKey(to='api.App', on_delete=models.CASCADE)), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ 'ordering': ['-created'], 'get_latest_by': 'created', + 'unique_together': {('app', 'uuid')}, }, - bases=(models.Model,), ), migrations.CreateModel( name='Certificate', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('certificate', models.TextField(validators=[api.models.validate_certificate])), - ('key', models.TextField()), - ('common_name', models.TextField(unique=True)), - ('expires', models.DateTimeField()), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('name', models.CharField(max_length=253, unique=True, validators=[api.models.validate_label])), + ('certificate', models.TextField(validators=[api.models.certificate.validate_certificate])), + ('key', models.TextField(validators=[api.models.certificate.validate_private_key])), + ('common_name', models.TextField(editable=False, null=True)), + ('san', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=253), null=True, size=None)), + ('fingerprint', models.CharField(editable=False, max_length=96)), + ('expires', models.DateTimeField(editable=False)), + ('starts', models.DateTimeField(editable=False)), + ('issuer', models.TextField(editable=False)), + ('subject', models.TextField(editable=False)), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ - 'abstract': False, + 'ordering': ['name', 'common_name', 'expires'], }, - bases=(models.Model,), ), migrations.CreateModel( name='Config', fields=[ - ('uuid', api.fields.UuidField(auto_created=True, primary_key=True, serialize=False, editable=False, max_length=32, unique=True, verbose_name='UUID')), + ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('values', jsonfield.fields.JSONField(default={}, blank=True)), - ('memory', jsonfield.fields.JSONField(default={}, blank=True)), - ('cpu', jsonfield.fields.JSONField(default={}, blank=True)), - ('tags', jsonfield.fields.JSONField(default={}, blank=True)), - ('app', models.ForeignKey(to='api.App', on_delete=models.CASCADE)), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('values', jsonfield.fields.JSONField(blank=True, default={})), + ('memory', jsonfield.fields.JSONField(blank=True, default={})), + ('lifecycle_post_start', jsonfield.fields.JSONField(blank=True, default={})), + ('lifecycle_pre_stop', jsonfield.fields.JSONField(blank=True, default={})), + ('cpu', jsonfield.fields.JSONField(blank=True, default={})), + ('tags', jsonfield.fields.JSONField(blank=True, default={})), + ('registry', jsonfield.fields.JSONField(blank=True, default={})), + ('healthcheck', jsonfield.fields.JSONField(blank=True, default={})), + ('termination_grace_period', jsonfield.fields.JSONField(blank=True, default={})), + ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ 'ordering': ['-created'], 'get_latest_by': 'created', + 'unique_together': {('app', 'uuid')}, }, - bases=(models.Model,), ), migrations.CreateModel( - name='Container', + name='Domain', fields=[ - ('uuid', api.fields.UuidField(auto_created=True, primary_key=True, serialize=False, editable=False, max_length=32, unique=True, verbose_name='UUID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('type', models.CharField(max_length=128)), - ('num', models.PositiveIntegerField()), - ('app', models.ForeignKey(to='api.App', on_delete=models.CASCADE)), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('domain', models.TextField(error_messages={'unique': 'Domain is already in use by another application'}, unique=True)), + ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), + ('certificate', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Certificate')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ - 'ordering': ['created'], - 'get_latest_by': '-created', + 'ordering': ['domain', 'certificate'], }, - bases=(models.Model,), ), migrations.CreateModel( - name='Domain', + name='TLS', fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('domain', models.TextField(unique=True)), - ('app', models.ForeignKey(to='api.App', on_delete=models.CASCADE)), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('https_enforced', models.NullBooleanField(default=None)), + ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ - 'abstract': False, + 'ordering': ['-created'], + 'get_latest_by': 'created', + 'unique_together': {('app', 'uuid')}, }, - bases=(models.Model,), ), migrations.CreateModel( - name='Key', + name='Service', fields=[ - ('uuid', api.fields.UuidField(auto_created=True, primary_key=True, serialize=False, editable=False, max_length=32, unique=True, verbose_name='UUID')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('id', models.CharField(max_length=128)), - ('public', models.TextField(unique=True, validators=[api.models.validate_base64])), - ('fingerprint', models.CharField(max_length=128)), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('procfile_type', models.TextField()), + ('path_pattern', models.TextField()), + ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ - 'verbose_name': 'SSH Key', + 'ordering': ['-created'], + 'get_latest_by': 'created', + 'unique_together': {('app', 'procfile_type')}, }, - bases=(models.Model,), ), migrations.CreateModel( - name='Push', + name='Release', fields=[ - ('uuid', api.fields.UuidField(auto_created=True, primary_key=True, serialize=False, editable=False, max_length=32, unique=True, verbose_name='UUID')), + ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('sha', models.CharField(max_length=40)), - ('fingerprint', models.CharField(max_length=255)), - ('receive_user', models.CharField(max_length=255)), - ('receive_repo', models.CharField(max_length=255)), - ('ssh_connection', models.CharField(max_length=255)), - ('ssh_original_command', models.CharField(max_length=255)), - ('app', models.ForeignKey(to='api.App', on_delete=models.CASCADE)), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('version', models.PositiveIntegerField()), + ('summary', models.TextField(blank=True, null=True)), + ('failed', models.BooleanField(default=False)), + ('exception', models.TextField(blank=True, null=True)), + ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), + ('build', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Build')), + ('config', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Config')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ 'ordering': ['-created'], 'get_latest_by': 'created', + 'unique_together': {('app', 'version')}, }, - bases=(models.Model,), ), migrations.CreateModel( - name='Release', + name='Key', fields=[ - ('uuid', api.fields.UuidField(auto_created=True, primary_key=True, serialize=False, editable=False, max_length=32, unique=True, verbose_name='UUID')), + ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), - ('version', models.PositiveIntegerField()), - ('summary', models.TextField(null=True, blank=True)), - ('app', models.ForeignKey(to='api.App', on_delete=models.CASCADE)), - ('build', models.ForeignKey(to='api.Build', null=True, on_delete=models.CASCADE)), - ('config', models.ForeignKey(to='api.Config', on_delete=models.CASCADE)), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), + ('id', models.CharField(max_length=128, unique=True)), + ('public', models.TextField(error_messages={'unique': 'Public Key is already in use'}, unique=True, validators=[api.models.key.validate_base64])), + ('fingerprint', models.CharField(editable=False, max_length=128)), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'SSH Key', + 'ordering': ['public'], + 'unique_together': {('owner', 'fingerprint')}, + }, + ), + migrations.CreateModel( + name='AppSettings', + fields=[ + ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), + ('created', models.DateTimeField(auto_now_add=True)), + ('updated', models.DateTimeField(auto_now=True)), + ('maintenance', models.NullBooleanField(default=None)), + ('routable', models.NullBooleanField(default=None)), + ('whitelist', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=None, size=None)), + ('autoscale', jsonfield.fields.JSONField(blank=True, default={})), + ('label', jsonfield.fields.JSONField(blank=True, default={})), + ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), ], options={ 'ordering': ['-created'], 'get_latest_by': 'created', + 'unique_together': {('app', 'uuid')}, }, - bases=(models.Model,), - ), - migrations.AlterUniqueTogether( - name='release', - unique_together=set([('app', 'version')]), - ), - migrations.AlterUniqueTogether( - name='push', - unique_together=set([('app', 'uuid')]), - ), - migrations.AlterUniqueTogether( - name='key', - unique_together=set([('owner', 'fingerprint')]), - ), - migrations.AddField( - model_name='container', - name='release', - field=models.ForeignKey(to='api.Release', on_delete=models.CASCADE), - preserve_default=True, - ), - migrations.AlterUniqueTogether( - name='config', - unique_together=set([('app', 'uuid')]), - ), - migrations.AlterUniqueTogether( - name='build', - unique_together=set([('app', 'uuid')]), ), ] diff --git a/rootfs/api/migrations/0002_auto_20151215_0352.py b/rootfs/api/migrations/0002_auto_20151215_0352.py deleted file mode 100644 index d47462a0..00000000 --- a/rootfs/api/migrations/0002_auto_20151215_0352.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- - -from django.db import migrations, models -import api.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='app', - name='id', - field=models.SlugField(max_length=24, unique=True, null=True, validators=[api.models.validate_app_id, api.models.validate_reserved_names]), - ), - migrations.AlterField( - model_name='app', - name='uuid', - field=models.UUIDField(serialize=False, verbose_name='UUID', primary_key=True), - ), - migrations.AlterField( - model_name='build', - name='uuid', - field=models.UUIDField(serialize=False, verbose_name='UUID', primary_key=True), - ), - migrations.AlterField( - model_name='config', - name='uuid', - field=models.UUIDField(serialize=False, verbose_name='UUID', primary_key=True), - ), - migrations.AlterField( - model_name='container', - name='uuid', - field=models.UUIDField(serialize=False, verbose_name='UUID', primary_key=True), - ), - migrations.AlterField( - model_name='key', - name='uuid', - field=models.UUIDField(serialize=False, verbose_name='UUID', primary_key=True), - ), - migrations.AlterField( - model_name='push', - name='uuid', - field=models.UUIDField(serialize=False, verbose_name='UUID', primary_key=True), - ), - migrations.AlterField( - model_name='release', - name='uuid', - field=models.UUIDField(serialize=False, verbose_name='UUID', primary_key=True), - ), - ] diff --git a/rootfs/api/migrations/0003_auto_20160114_0310.py b/rootfs/api/migrations/0003_auto_20160114_0310.py deleted file mode 100644 index dd3b8fa9..00000000 --- a/rootfs/api/migrations/0003_auto_20160114_0310.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-01-14 03:10 -from __future__ import unicode_literals - -from django.db import migrations, models -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0002_auto_20151215_0352'), - ] - - operations = [ - migrations.AlterField( - model_name='app', - name='uuid', - field=models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID'), - ), - migrations.AlterField( - model_name='build', - name='uuid', - field=models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID'), - ), - migrations.AlterField( - model_name='config', - name='uuid', - field=models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID'), - ), - migrations.AlterField( - model_name='container', - name='uuid', - field=models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID'), - ), - migrations.AlterField( - model_name='key', - name='uuid', - field=models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID'), - ), - migrations.AlterField( - model_name='push', - name='uuid', - field=models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID'), - ), - migrations.AlterField( - model_name='release', - name='uuid', - field=models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID'), - ), - ] diff --git a/rootfs/api/migrations/0004_auto_20160124_2134.py b/rootfs/api/migrations/0004_auto_20160124_2134.py deleted file mode 100644 index df571b49..00000000 --- a/rootfs/api/migrations/0004_auto_20160124_2134.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-01-24 21:34 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0003_auto_20160114_0310'), - ] - - operations = [ - migrations.AlterField( - model_name='certificate', - name='expires', - field=models.DateTimeField(editable=False), - ), - migrations.AlterField( - model_name='key', - name='fingerprint', - field=models.CharField(editable=False, max_length=128), - ), - ] diff --git a/rootfs/api/migrations/0005_auto_20160208_2156.py b/rootfs/api/migrations/0005_auto_20160208_2156.py deleted file mode 100644 index c8ee6870..00000000 --- a/rootfs/api/migrations/0005_auto_20160208_2156.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-02-08 21:56 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0004_auto_20160124_2134'), - ] - - operations = [ - migrations.AlterField( - model_name='build', - name='image', - field=models.TextField(), - ), - ] diff --git a/rootfs/api/migrations/0006_auto_20160114_0313.py b/rootfs/api/migrations/0006_auto_20160114_0313.py deleted file mode 100644 index 41e1c9f5..00000000 --- a/rootfs/api/migrations/0006_auto_20160114_0313.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-01-14 03:13 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import api.models -import uuid -import datetime -from django.utils.timezone import utc - - -def fix_cert(apps, schema_editor): - # We can't import the Person model directly as it may be a newer - # version than this migration expects. We use the historical version. - certificate = apps.get_model("api", "Certificate") - for cert in certificate.objects.all(): - # many new fields are updated - cert.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0005_auto_20160208_2156'), - ] - - operations = [ - migrations.AddField( - model_name='certificate', - name='fingerprint', - field=models.CharField(default=datetime.datetime(2016, 1, 28, 5, 52, 47, 586393, tzinfo=utc), editable=False, max_length=96), - preserve_default=False, - ), - migrations.AddField( - model_name='certificate', - name='name', - field=models.CharField(default=datetime.datetime(2016, 1, 28, 5, 52, 47, 586393, tzinfo=utc), max_length=253, unique=True, validators=[api.models.validate_label]), - preserve_default=False, - ), - migrations.AddField( - model_name='certificate', - name='san', - field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=253), null=True, size=None), - ), - migrations.AlterField( - model_name='certificate', - name='common_name', - field=models.TextField(editable=False, unique=False), - ), - migrations.AddField( - model_name='domain', - name='certificate', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Certificate'), - ), - migrations.AddField( - model_name='certificate', - name='issuer', - field=models.TextField(default=datetime.datetime(2016, 1, 28, 5, 52, 47, 586393, tzinfo=utc), editable=False), - preserve_default=False, - ), - migrations.AddField( - model_name='certificate', - name='starts', - field=models.DateTimeField(default=datetime.datetime(2016, 1, 28, 5, 52, 47, 586393, tzinfo=utc), editable=False), - preserve_default=False, - ), - migrations.AddField( - model_name='certificate', - name='subject', - field=models.TextField(default=datetime.datetime(2016, 1, 28, 5, 52, 47, 586393, tzinfo=utc), editable=False), - preserve_default=False, - ), - migrations.RunPython(fix_cert), - ] diff --git a/rootfs/api/migrations/0007_auto_20160226_2335.py b/rootfs/api/migrations/0007_auto_20160226_2335.py deleted file mode 100644 index c8090d2f..00000000 --- a/rootfs/api/migrations/0007_auto_20160226_2335.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-02-26 23:35 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0006_auto_20160114_0313'), - ] - - operations = [ - migrations.RemoveField( - model_name='container', - name='app', - ), - migrations.RemoveField( - model_name='container', - name='owner', - ), - migrations.RemoveField( - model_name='container', - name='release', - ), - migrations.DeleteModel( - name='Container', - ), - ] diff --git a/rootfs/api/migrations/0008_config_registry.py b/rootfs/api/migrations/0008_config_registry.py deleted file mode 100644 index d96aef5f..00000000 --- a/rootfs/api/migrations/0008_config_registry.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-04-21 19:06 -from __future__ import unicode_literals - -from django.db import migrations -import jsonfield.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0007_auto_20160226_2335'), - ] - - operations = [ - migrations.AddField( - model_name='config', - name='registry', - field=jsonfield.fields.JSONField(blank=True, default={}), - ), - ] diff --git a/rootfs/api/migrations/0009_auto_20160607_2259.py b/rootfs/api/migrations/0009_auto_20160607_2259.py deleted file mode 100644 index c7a0ae1e..00000000 --- a/rootfs/api/migrations/0009_auto_20160607_2259.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.6 on 2016-06-07 22:59 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0008_config_registry'), - ] - - operations = [ - migrations.AlterField( - model_name='app', - name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='build', - name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='certificate', - name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='config', - name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='domain', - name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='key', - name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='push', - name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='release', - name='owner', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/rootfs/api/migrations/0010_config_healthcheck.py b/rootfs/api/migrations/0010_config_healthcheck.py deleted file mode 100644 index e82951ed..00000000 --- a/rootfs/api/migrations/0010_config_healthcheck.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-06-17 20:18 -from __future__ import unicode_literals - -from django.db import migrations -import jsonfield.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0009_auto_20160607_2259'), - ] - - operations = [ - migrations.AddField( - model_name='config', - name='healthcheck', - field=jsonfield.fields.JSONField(blank=True, default={}), - ), - ] diff --git a/rootfs/api/migrations/0011_auto_20160810_1603.py b/rootfs/api/migrations/0011_auto_20160810_1603.py deleted file mode 100644 index f8750862..00000000 --- a/rootfs/api/migrations/0011_auto_20160810_1603.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.8 on 2016-08-10 16:03 -from __future__ import unicode_literals - -import api.models.key -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0010_config_healthcheck'), - ] - - operations = [ - migrations.AlterModelOptions( - name='app', - options={'ordering': ['id'], 'permissions': (('use_app', 'Can use app'),), 'verbose_name': 'Application'}, - ), - migrations.AlterModelOptions( - name='certificate', - options={'ordering': ['name', 'common_name', 'expires']}, - ), - migrations.AlterModelOptions( - name='domain', - options={'ordering': ['domain', 'certificate']}, - ), - migrations.AlterModelOptions( - name='key', - options={'ordering': ['public'], 'verbose_name': 'SSH Key'}, - ), - migrations.AlterField( - model_name='domain', - name='domain', - field=models.TextField(error_messages={'unique': 'Domain is already in use by another application'}, unique=True), - ), - migrations.AlterField( - model_name='key', - name='public', - field=models.TextField(error_messages={'unique': 'Public Key is already in use'}, unique=True, validators=[api.models.key.validate_base64]), - ), - ] diff --git a/rootfs/api/migrations/0012_auto_20160816_1934.py b/rootfs/api/migrations/0012_auto_20160816_1934.py deleted file mode 100644 index 037a6d54..00000000 --- a/rootfs/api/migrations/0012_auto_20160816_1934.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.8 on 2016-08-16 19:34 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('api', '0011_auto_20160810_1603'), - ] - - operations = [ - migrations.CreateModel( - name='AppSettings', - fields=[ - ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), - ('maintenance', models.NullBooleanField(default=None)), - ('routable', models.NullBooleanField(default=None)), - ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), - ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'get_latest_by': 'created', - 'ordering': ['-created'], - }, - ), - migrations.AlterUniqueTogether( - name='appsettings', - unique_together=set([('app', 'uuid')]), - ), - ] diff --git a/rootfs/api/migrations/0013_auto_20160816_2122.py b/rootfs/api/migrations/0013_auto_20160816_2122.py deleted file mode 100644 index 7edc60c4..00000000 --- a/rootfs/api/migrations/0013_auto_20160816_2122.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.8 on 2016-08-16 21:22 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0012_auto_20160816_1934'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='push', - unique_together=set([]), - ), - migrations.RemoveField( - model_name='push', - name='app', - ), - migrations.RemoveField( - model_name='push', - name='owner', - ), - migrations.DeleteModel( - name='Push', - ), - ] diff --git a/rootfs/api/migrations/0014_appsettings_whitelist.py b/rootfs/api/migrations/0014_appsettings_whitelist.py deleted file mode 100644 index 21b2e1a7..00000000 --- a/rootfs/api/migrations/0014_appsettings_whitelist.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10 on 2016-08-23 22:58 -from __future__ import unicode_literals - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0013_auto_20160816_2122'), - ] - - operations = [ - migrations.AddField( - model_name='appsettings', - name='whitelist', - field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=[], size=None), - ), - ] diff --git a/rootfs/api/migrations/0015_auto_20160822_2103.py b/rootfs/api/migrations/0015_auto_20160822_2103.py deleted file mode 100644 index 80cbfe5f..00000000 --- a/rootfs/api/migrations/0015_auto_20160822_2103.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.8 on 2016-08-22 21:03 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('api', '0014_appsettings_whitelist'), - ] - - operations = [ - migrations.CreateModel( - name='TLS', - fields=[ - ('uuid', models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='UUID')), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), - ('https_enforced', models.NullBooleanField(default=None)), - ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), - ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'ordering': ['-created'], - 'get_latest_by': 'created', - }, - ), - migrations.AlterUniqueTogether( - name='tls', - unique_together=set([('app', 'uuid')]), - ), - ] diff --git a/rootfs/api/migrations/0016_auto_20160830_0104.py b/rootfs/api/migrations/0016_auto_20160830_0104.py deleted file mode 100644 index d73124ca..00000000 --- a/rootfs/api/migrations/0016_auto_20160830_0104.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10 on 2016-08-30 01:04 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0015_auto_20160822_2103'), - ] - - operations = [ - migrations.AlterField( - model_name='certificate', - name='common_name', - field=models.TextField(editable=False, null=True), - ), - ] diff --git a/rootfs/api/migrations/0017_appsettings_autoscale.py b/rootfs/api/migrations/0017_appsettings_autoscale.py deleted file mode 100644 index 86c7a30a..00000000 --- a/rootfs/api/migrations/0017_appsettings_autoscale.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10 on 2016-08-30 17:32 -from __future__ import unicode_literals - -from django.db import migrations -import jsonfield.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0016_auto_20160830_0104'), - ] - - operations = [ - migrations.AddField( - model_name='appsettings', - name='autoscale', - field=jsonfield.fields.JSONField(blank=True, default={}), - ), - ] diff --git a/rootfs/api/migrations/0018_auto_20160908_1748.py b/rootfs/api/migrations/0018_auto_20160908_1748.py deleted file mode 100644 index 5e80e14c..00000000 --- a/rootfs/api/migrations/0018_auto_20160908_1748.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10 on 2016-09-08 17:48 -from __future__ import unicode_literals - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0017_appsettings_autoscale'), - ] - - operations = [ - migrations.AlterField( - model_name='appsettings', - name='whitelist', - field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=None, size=None), - ), - ] diff --git a/rootfs/api/migrations/0019_auto_20160930_2351.py b/rootfs/api/migrations/0019_auto_20160930_2351.py deleted file mode 100644 index da57fcb2..00000000 --- a/rootfs/api/migrations/0019_auto_20160930_2351.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10 on 2016-09-30 23:51 -from __future__ import unicode_literals - -from django.db import migrations, models -from django.db.models import Count - - -def fix_duplicate_keys(apps, schema_editor): - Keys = apps.get_model("api", "Key") - - # find duplicates - duplicates = Keys.objects.values('id') \ - .annotate(Count('id')) \ - .order_by() \ - .filter(id__count__gt=1) - for dup in duplicates: - # update all duplicates - inc = 1 - for key in Keys.objects.filter(id=dup['id']): - key_id = '{}-{}'.format(key.id, inc) - key.id = key_id - key.save() - inc += 1 - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0018_auto_20160908_1748'), - ] - - operations = [ - migrations.RunPython(fix_duplicate_keys), - migrations.AlterField( - model_name='key', - name='id', - field=models.CharField(max_length=128, unique=True), - ), - ] diff --git a/rootfs/api/migrations/0020_release_failed.py b/rootfs/api/migrations/0020_release_failed.py deleted file mode 100644 index f3b3c3b1..00000000 --- a/rootfs/api/migrations/0020_release_failed.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.1 on 2016-10-03 18:50 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0019_auto_20160930_2351'), - ] - - operations = [ - migrations.AddField( - model_name='release', - name='failed', - field=models.BooleanField(default=False), - ), - ] diff --git a/rootfs/api/migrations/0021_appsettings_label.py b/rootfs/api/migrations/0021_appsettings_label.py deleted file mode 100644 index aed695fc..00000000 --- a/rootfs/api/migrations/0021_appsettings_label.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.2 on 2016-11-19 16:11 -from __future__ import unicode_literals - -from django.db import migrations -import jsonfield.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0020_release_failed'), - ] - - operations = [ - migrations.AddField( - model_name='appsettings', - name='label', - field=jsonfield.fields.JSONField(blank=True, default={}), - ), - ] diff --git a/rootfs/api/migrations/0022_add_private_key_validation.py b/rootfs/api/migrations/0022_add_private_key_validation.py deleted file mode 100644 index 8dd4193a..00000000 --- a/rootfs/api/migrations/0022_add_private_key_validation.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.4 on 2017-01-11 22:19 -from __future__ import unicode_literals - -import api.models.certificate -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0021_appsettings_label'), - ] - - operations = [ - migrations.AlterField( - model_name='certificate', - name='key', - field=models.TextField(validators=[api.models.certificate.validate_private_key]), - ), - ] diff --git a/rootfs/api/migrations/0023_app_k8s_name_length.py b/rootfs/api/migrations/0023_app_k8s_name_length.py deleted file mode 100644 index 5ee7cbd3..00000000 --- a/rootfs/api/migrations/0023_app_k8s_name_length.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.4 on 2017-01-11 22:15 -from __future__ import unicode_literals - -import api.models.app -import api.models.certificate -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0022_add_private_key_validation'), - ] - - operations = [ - migrations.AlterField( - model_name='app', - name='id', - field=models.SlugField(max_length=63, null=True, unique=True, validators=[api.models.app.validate_app_id, api.models.app.validate_reserved_names]), - ), - ] diff --git a/rootfs/api/migrations/0024_config_lifecycle_hooks.py b/rootfs/api/migrations/0024_config_lifecycle_hooks.py deleted file mode 100644 index c23d80f9..00000000 --- a/rootfs/api/migrations/0024_config_lifecycle_hooks.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.2 on 2017-06-22 18:42 -from __future__ import unicode_literals - -from django.db import migrations -import jsonfield.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0023_app_k8s_name_length'), - ] - - operations = [ - migrations.AddField( - model_name='config', - name='lifecycle_post_start', - field=jsonfield.fields.JSONField(blank=True, default={}), - ), - migrations.AddField( - model_name='config', - name='lifecycle_pre_stop', - field=jsonfield.fields.JSONField(blank=True, default={}), - ), - ] diff --git a/rootfs/api/migrations/0025_app_procfile_structure.py b/rootfs/api/migrations/0025_app_procfile_structure.py deleted file mode 100644 index efee506e..00000000 --- a/rootfs/api/migrations/0025_app_procfile_structure.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.2 on 2017-08-14 20:45 -from __future__ import unicode_literals - -import api.models.app -from django.db import migrations -import jsonfield.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0024_config_lifecycle_hooks'), - ] - - operations = [ - migrations.AddField( - model_name='app', - name='procfile_structure', - field=jsonfield.fields.JSONField(blank=True, default={}, validators=[api.models.app.validate_app_structure]), - ), - ] diff --git a/rootfs/api/migrations/0026_release_exception.py b/rootfs/api/migrations/0026_release_exception.py deleted file mode 100644 index 3f681cc7..00000000 --- a/rootfs/api/migrations/0026_release_exception.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.2 on 2017-08-28 14:59 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0025_app_procfile_structure'), - ] - - operations = [ - migrations.AddField( - model_name='release', - name='exception', - field=models.TextField(blank=True, null=True), - ), - ] diff --git a/rootfs/api/migrations/0027_auto_20180424_1742.py b/rootfs/api/migrations/0027_auto_20180424_1742.py deleted file mode 100644 index be29e789..00000000 --- a/rootfs/api/migrations/0027_auto_20180424_1742.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.4 on 2018-04-24 17:42 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('api', '0026_release_exception'), - ] - - operations = [ - migrations.CreateModel( - name='Service', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True)), - ('updated', models.DateTimeField(auto_now=True)), - ('procfile_type', models.TextField()), - ('path_pattern', models.TextField()), - ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.App')), - ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'ordering': ['-created'], - 'get_latest_by': 'created', - }, - ), - migrations.AlterUniqueTogether( - name='service', - unique_together=set([('app', 'procfile_type')]), - ), - ] diff --git a/rootfs/api/migrations/0028_config_termination_grace_period.py b/rootfs/api/migrations/0028_config_termination_grace_period.py deleted file mode 100644 index c21c0afa..00000000 --- a/rootfs/api/migrations/0028_config_termination_grace_period.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.4 on 2018-04-24 01:41 -from __future__ import unicode_literals - -from django.db import migrations -import jsonfield.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0027_auto_20180424_1742'), - ] - - operations = [ - migrations.AddField( - model_name='config', - name='termination_grace_period', - field=jsonfield.fields.JSONField(blank=True, default={}), - ), - ]