From 783ba5acedf16ab1b93ba25e74443d90ba0aff91 Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Tue, 14 Apr 2020 10:40:35 -0400 Subject: [PATCH] Squash migrations --- shynet/a17t/migrations/__init__.py | 0 shynet/analytics/migrations/0001_initial.py | 106 ++++++----- .../migrations/0002_auto_20200410_0258.py | 31 ---- .../migrations/0003_auto_20200410_1325.py | 15 -- .../migrations/0004_auto_20200411_1541.py | 29 --- .../analytics/migrations/0005_hit_initial.py | 16 -- .../migrations/0006_auto_20200412_0003.py | 29 --- .../migrations/0007_auto_20200412_0010.py | 28 --- .../migrations/0008_auto_20200412_0015.py | 16 -- .../migrations/0009_auto_20200414_1008.py | 76 -------- shynet/core/migrations/0001_initial.py | 172 ++++-------------- .../migrations/0002_service_anonymize_ips.py | 18 -- .../0003_remove_service_anonymize_ips.py | 14 -- shynet/dashboard/migrations/__init__.py | 0 14 files changed, 96 insertions(+), 454 deletions(-) delete mode 100644 shynet/a17t/migrations/__init__.py delete mode 100644 shynet/analytics/migrations/0002_auto_20200410_0258.py delete mode 100644 shynet/analytics/migrations/0003_auto_20200410_1325.py delete mode 100644 shynet/analytics/migrations/0004_auto_20200411_1541.py delete mode 100644 shynet/analytics/migrations/0005_hit_initial.py delete mode 100644 shynet/analytics/migrations/0006_auto_20200412_0003.py delete mode 100644 shynet/analytics/migrations/0007_auto_20200412_0010.py delete mode 100644 shynet/analytics/migrations/0008_auto_20200412_0015.py delete mode 100644 shynet/analytics/migrations/0009_auto_20200414_1008.py delete mode 100644 shynet/core/migrations/0002_service_anonymize_ips.py delete mode 100644 shynet/core/migrations/0003_remove_service_anonymize_ips.py delete mode 100644 shynet/dashboard/migrations/__init__.py diff --git a/shynet/a17t/migrations/__init__.py b/shynet/a17t/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/shynet/analytics/migrations/0001_initial.py b/shynet/analytics/migrations/0001_initial.py index 0cc8d69..5823312 100644 --- a/shynet/analytics/migrations/0001_initial.py +++ b/shynet/analytics/migrations/0001_initial.py @@ -1,65 +1,79 @@ -# Generated by Django 3.0.5 on 2020-04-10 06:58 - -from django.db import migrations, models +# Generated by Django 3.0.5 on 2020-04-14 14:40 import analytics.models +from django.db import migrations, models +import django.db.models.deletion class Migration(migrations.Migration): initial = True - dependencies = [] + dependencies = [ + ('core', '0001_initial'), + ] operations = [ migrations.CreateModel( - name="Hit", + name='Session', fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("start", models.DateTimeField(auto_now_add=True)), - ("duration", models.FloatField(default=0.0)), - ("heartbeats", models.IntegerField(default=0)), - ("tracker", models.TextField()), - ("location", models.TextField(blank=True)), - ("referrer", models.TextField(blank=True)), - ("loadTime", models.FloatField(null=True)), - ("httpStatus", models.IntegerField(null=True)), - ("metadata_raw", models.TextField()), + ('uuid', models.UUIDField(default=analytics.models._default_uuid, primary_key=True, serialize=False)), + ('identifier', models.TextField(blank=True, db_index=True)), + ('start_time', models.DateTimeField(auto_now_add=True, db_index=True)), + ('last_seen', models.DateTimeField(auto_now_add=True)), + ('user_agent', models.TextField()), + ('browser', models.TextField()), + ('device', models.TextField()), + ('device_type', models.CharField(choices=[('PHONE', 'Phone'), ('TABLET', 'Tablet'), ('DESKTOP', 'Desktop'), ('ROBOT', 'Robot'), ('OTHER', 'Other')], default='OTHER', max_length=7)), + ('os', models.TextField()), + ('ip', models.GenericIPAddressField(db_index=True)), + ('asn', models.TextField(blank=True)), + ('country', models.TextField(blank=True)), + ('longitude', models.FloatField(null=True)), + ('latitude', models.FloatField(null=True)), + ('time_zone', models.TextField(blank=True)), + ('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Service')), ], + options={ + 'ordering': ['-start_time'], + }, ), migrations.CreateModel( - name="Session", + name='Hit', fields=[ - ( - "uuid", - models.UUIDField( - default=analytics.models._default_uuid, - primary_key=True, - serialize=False, - ), - ), - ("identifier", models.TextField(blank=True)), - ("first_seen", models.DateTimeField(auto_now_add=True)), - ("last_seen", models.DateTimeField(auto_now_add=True)), - ("user_agent", models.TextField()), - ("browser", models.TextField()), - ("device", models.TextField()), - ("os", models.TextField()), - ("ip", models.GenericIPAddressField()), - ("asn", models.TextField(blank=True)), - ("country", models.TextField(blank=True)), - ("longitude", models.FloatField(null=True)), - ("latitude", models.FloatField(null=True)), - ("time_zone", models.TextField(blank=True)), - ("metadata_raw", models.TextField()), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('initial', models.BooleanField(db_index=True, default=True)), + ('start_time', models.DateTimeField(auto_now_add=True, db_index=True)), + ('last_seen', models.DateTimeField(auto_now_add=True)), + ('heartbeats', models.IntegerField(default=0)), + ('tracker', models.TextField()), + ('location', models.TextField(blank=True, db_index=True)), + ('referrer', models.TextField(blank=True, db_index=True)), + ('load_time', models.FloatField(null=True)), + ('session', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='analytics.Session')), ], + options={ + 'ordering': ['-start_time'], + }, + ), + migrations.AddIndex( + model_name='session', + index=models.Index(fields=['service', '-start_time'], name='analytics_s_service_4b1137_idx'), + ), + migrations.AddIndex( + model_name='session', + index=models.Index(fields=['service', 'identifier'], name='analytics_s_service_82ab21_idx'), + ), + migrations.AddIndex( + model_name='hit', + index=models.Index(fields=['session', '-start_time'], name='analytics_h_session_b2667f_idx'), + ), + migrations.AddIndex( + model_name='hit', + index=models.Index(fields=['session', 'location'], name='analytics_h_session_775f5a_idx'), + ), + migrations.AddIndex( + model_name='hit', + index=models.Index(fields=['session', 'referrer'], name='analytics_h_session_98b8bf_idx'), ), ] diff --git a/shynet/analytics/migrations/0002_auto_20200410_0258.py b/shynet/analytics/migrations/0002_auto_20200410_0258.py deleted file mode 100644 index db60bdd..0000000 --- a/shynet/analytics/migrations/0002_auto_20200410_0258.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-10 06:58 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ("core", "0001_initial"), - ("analytics", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="session", - name="service", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="core.Service" - ), - ), - migrations.AddField( - model_name="hit", - name="session", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="analytics.Session" - ), - ), - ] diff --git a/shynet/analytics/migrations/0003_auto_20200410_1325.py b/shynet/analytics/migrations/0003_auto_20200410_1325.py deleted file mode 100644 index 991f2b8..0000000 --- a/shynet/analytics/migrations/0003_auto_20200410_1325.py +++ /dev/null @@ -1,15 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-10 17:25 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("analytics", "0002_auto_20200410_0258"), - ] - - operations = [ - migrations.RemoveField(model_name="hit", name="metadata_raw",), - migrations.RemoveField(model_name="session", name="metadata_raw",), - ] diff --git a/shynet/analytics/migrations/0004_auto_20200411_1541.py b/shynet/analytics/migrations/0004_auto_20200411_1541.py deleted file mode 100644 index 28da2c1..0000000 --- a/shynet/analytics/migrations/0004_auto_20200411_1541.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-11 19:41 - -import django.utils.timezone -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("analytics", "0003_auto_20200410_1325"), - ] - - operations = [ - migrations.RenameField( - model_name="hit", old_name="start", new_name="start_time", - ), - migrations.RenameField( - model_name="session", old_name="first_seen", new_name="start_time", - ), - migrations.RemoveField(model_name="hit", name="duration",), - migrations.AddField( - model_name="hit", - name="last_seen", - field=models.DateTimeField( - auto_now_add=True, default=django.utils.timezone.now - ), - preserve_default=False, - ), - ] diff --git a/shynet/analytics/migrations/0005_hit_initial.py b/shynet/analytics/migrations/0005_hit_initial.py deleted file mode 100644 index 11b011d..0000000 --- a/shynet/analytics/migrations/0005_hit_initial.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-12 03:47 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("analytics", "0004_auto_20200411_1541"), - ] - - operations = [ - migrations.AddField( - model_name="hit", name="initial", field=models.BooleanField(default=True), - ), - ] diff --git a/shynet/analytics/migrations/0006_auto_20200412_0003.py b/shynet/analytics/migrations/0006_auto_20200412_0003.py deleted file mode 100644 index 60c5597..0000000 --- a/shynet/analytics/migrations/0006_auto_20200412_0003.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-12 04:03 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("analytics", "0005_hit_initial"), - ] - - operations = [ - migrations.RemoveField(model_name="hit", name="httpStatus",), - migrations.AddField( - model_name="session", - name="device_type", - field=models.CharField( - choices=[ - ("PHONE", "Phone"), - ("TABLET", "Tablet"), - ("DESK", "Desktop / Laptop"), - ("ROBOT", "Robot"), - ("OTHER", "Other"), - ], - default="OTHER", - max_length=6, - ), - ), - ] diff --git a/shynet/analytics/migrations/0007_auto_20200412_0010.py b/shynet/analytics/migrations/0007_auto_20200412_0010.py deleted file mode 100644 index 9c868c3..0000000 --- a/shynet/analytics/migrations/0007_auto_20200412_0010.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-12 04:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("analytics", "0006_auto_20200412_0003"), - ] - - operations = [ - migrations.AlterField( - model_name="session", - name="device_type", - field=models.CharField( - choices=[ - ("PHONE", "Phone"), - ("TABLET", "Tablet"), - ("DESKTOP", "Desktop"), - ("ROBOT", "Robot"), - ("OTHER", "Other"), - ], - default="OTHER", - max_length=7, - ), - ), - ] diff --git a/shynet/analytics/migrations/0008_auto_20200412_0015.py b/shynet/analytics/migrations/0008_auto_20200412_0015.py deleted file mode 100644 index c044fda..0000000 --- a/shynet/analytics/migrations/0008_auto_20200412_0015.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-12 04:15 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("analytics", "0007_auto_20200412_0010"), - ] - - operations = [ - migrations.RenameField( - model_name="hit", old_name="loadTime", new_name="load_time", - ), - ] diff --git a/shynet/analytics/migrations/0009_auto_20200414_1008.py b/shynet/analytics/migrations/0009_auto_20200414_1008.py deleted file mode 100644 index 2e595d7..0000000 --- a/shynet/analytics/migrations/0009_auto_20200414_1008.py +++ /dev/null @@ -1,76 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-14 14:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('analytics', '0008_auto_20200412_0015'), - ] - - operations = [ - migrations.AlterModelOptions( - name='hit', - options={'ordering': ['-start_time']}, - ), - migrations.AlterModelOptions( - name='session', - options={'ordering': ['-start_time']}, - ), - migrations.AlterField( - model_name='hit', - name='initial', - field=models.BooleanField(db_index=True, default=True), - ), - migrations.AlterField( - model_name='hit', - name='location', - field=models.TextField(blank=True, db_index=True), - ), - migrations.AlterField( - model_name='hit', - name='referrer', - field=models.TextField(blank=True, db_index=True), - ), - migrations.AlterField( - model_name='hit', - name='start_time', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='session', - name='identifier', - field=models.TextField(blank=True, db_index=True), - ), - migrations.AlterField( - model_name='session', - name='ip', - field=models.GenericIPAddressField(db_index=True), - ), - migrations.AlterField( - model_name='session', - name='start_time', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AddIndex( - model_name='hit', - index=models.Index(fields=['session', '-start_time'], name='analytics_h_session_b2667f_idx'), - ), - migrations.AddIndex( - model_name='hit', - index=models.Index(fields=['session', 'location'], name='analytics_h_session_775f5a_idx'), - ), - migrations.AddIndex( - model_name='hit', - index=models.Index(fields=['session', 'referrer'], name='analytics_h_session_98b8bf_idx'), - ), - migrations.AddIndex( - model_name='session', - index=models.Index(fields=['service', '-start_time'], name='analytics_s_service_4b1137_idx'), - ), - migrations.AddIndex( - model_name='session', - index=models.Index(fields=['service', 'identifier'], name='analytics_s_service_82ab21_idx'), - ), - ] diff --git a/shynet/core/migrations/0001_initial.py b/shynet/core/migrations/0001_initial.py index d058e5a..767e134 100644 --- a/shynet/core/migrations/0001_initial.py +++ b/shynet/core/migrations/0001_initial.py @@ -1,12 +1,11 @@ -# Generated by Django 3.0.5 on 2020-04-10 06:58 - -import django.contrib.auth.models -import django.db.models.deletion -import django.utils.timezone -from django.conf import settings -from django.db import migrations, models +# Generated by Django 3.0.5 on 2020-04-14 14:40 import core.models +from django.conf import settings +import django.contrib.auth.models +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone class Migration(migrations.Migration): @@ -14,146 +13,47 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ("auth", "0011_update_proxy_permissions"), + ('auth', '0011_update_proxy_permissions'), ] operations = [ migrations.CreateModel( - name="User", + name='User', fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("password", models.CharField(max_length=128, verbose_name="password")), - ( - "last_login", - models.DateTimeField( - blank=True, null=True, verbose_name="last login" - ), - ), - ( - "is_superuser", - models.BooleanField( - default=False, - help_text="Designates that this user has all permissions without explicitly assigning them.", - verbose_name="superuser status", - ), - ), - ( - "first_name", - models.CharField( - blank=True, max_length=30, verbose_name="first name" - ), - ), - ( - "last_name", - models.CharField( - blank=True, max_length=150, verbose_name="last name" - ), - ), - ( - "is_staff", - models.BooleanField( - default=False, - help_text="Designates whether the user can log into this admin site.", - verbose_name="staff status", - ), - ), - ( - "is_active", - models.BooleanField( - default=True, - help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.", - verbose_name="active", - ), - ), - ( - "date_joined", - models.DateTimeField( - default=django.utils.timezone.now, verbose_name="date joined" - ), - ), - ( - "username", - models.TextField(default=core.models._default_uuid, unique=True), - ), - ("email", models.EmailField(max_length=254, unique=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", - ), - ), - ( - "user_permissions", - 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", - ), - ), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), + ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), + ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), + ('username', models.TextField(default=core.models._default_uuid, unique=True)), + ('email', models.EmailField(max_length=254, unique=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')), + ('user_permissions', 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')), ], options={ - "verbose_name": "user", - "verbose_name_plural": "users", - "abstract": False, + 'verbose_name': 'user', + 'verbose_name_plural': 'users', + 'abstract': False, }, - managers=[("objects", django.contrib.auth.models.UserManager()),], + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], ), migrations.CreateModel( - name="Service", + name='Service', fields=[ - ( - "uuid", - models.UUIDField( - default=core.models._default_uuid, - primary_key=True, - serialize=False, - ), - ), - ("name", models.TextField(max_length=64)), - ("created", models.DateTimeField(auto_now_add=True)), - ("link", models.URLField(blank=True)), - ("origins", models.TextField(default="*")), - ( - "status", - models.CharField( - choices=[("AC", "Active"), ("AR", "Archived")], - db_index=True, - default="AC", - max_length=2, - ), - ), - ( - "collaborators", - models.ManyToManyField( - blank=True, - related_name="collaborating_services", - to=settings.AUTH_USER_MODEL, - ), - ), - ( - "owner", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="owning_services", - to=settings.AUTH_USER_MODEL, - ), - ), + ('uuid', models.UUIDField(default=core.models._default_uuid, primary_key=True, serialize=False)), + ('name', models.TextField(max_length=64)), + ('created', models.DateTimeField(auto_now_add=True)), + ('link', models.URLField(blank=True)), + ('origins', models.TextField(default='*')), + ('status', models.CharField(choices=[('AC', 'Active'), ('AR', 'Archived')], db_index=True, default='AC', max_length=2)), + ('collaborators', models.ManyToManyField(blank=True, related_name='collaborating_services', to=settings.AUTH_USER_MODEL)), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owning_services', to=settings.AUTH_USER_MODEL)), ], ), ] diff --git a/shynet/core/migrations/0002_service_anonymize_ips.py b/shynet/core/migrations/0002_service_anonymize_ips.py deleted file mode 100644 index d5c87ee..0000000 --- a/shynet/core/migrations/0002_service_anonymize_ips.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-11 22:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="service", - name="anonymize_ips", - field=models.BooleanField(default=False), - ), - ] diff --git a/shynet/core/migrations/0003_remove_service_anonymize_ips.py b/shynet/core/migrations/0003_remove_service_anonymize_ips.py deleted file mode 100644 index 0769597..0000000 --- a/shynet/core/migrations/0003_remove_service_anonymize_ips.py +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-11 23:25 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0002_service_anonymize_ips"), - ] - - operations = [ - migrations.RemoveField(model_name="service", name="anonymize_ips",), - ] diff --git a/shynet/dashboard/migrations/__init__.py b/shynet/dashboard/migrations/__init__.py deleted file mode 100644 index e69de29..0000000