From 118d441a23f622893671046b8a80d64ab32d133e Mon Sep 17 00:00:00 2001
From: Jan-Tarek Butt <tarek@ring0.de>
Date: Wed, 13 Dec 2023 22:33:45 +0100
Subject: [PATCH] crawler: add various migration scripts

Signed-off-by: Jan-Tarek Butt <tarek@ring0.de>
---
 .../migrations/0007_alter_monitor_notify.py   | 18 +++++++++++++
 ...itor_notify_count_monitor_status_change.py | 23 +++++++++++++++++
 ...tor_status_change_monitor_last_notified.py | 24 ++++++++++++++++++
 crawler/migrations/0010_userprofile.py        | 25 +++++++++++++++++++
 ...file_days_between_notification_and_more.py | 23 +++++++++++++++++
 .../migrations/0012_alter_node_entry_date.py  | 18 +++++++++++++
 ...tor_last_notified_alter_node_entry_date.py | 23 +++++++++++++++++
 crawler/migrations/0014_node_last_seen.py     | 20 +++++++++++++++
 .../migrations/0015_alter_node_last_seen.py   | 18 +++++++++++++
 .../0016_alter_monitor_last_notified.py       | 18 +++++++++++++
 .../0017_alter_monitor_last_notified.py       | 18 +++++++++++++
 11 files changed, 228 insertions(+)
 create mode 100644 crawler/migrations/0007_alter_monitor_notify.py
 create mode 100644 crawler/migrations/0008_monitor_notify_count_monitor_status_change.py
 create mode 100644 crawler/migrations/0009_remove_monitor_status_change_monitor_last_notified.py
 create mode 100644 crawler/migrations/0010_userprofile.py
 create mode 100644 crawler/migrations/0011_rename_days_between_notifikation_userprofile_days_between_notification_and_more.py
 create mode 100644 crawler/migrations/0012_alter_node_entry_date.py
 create mode 100644 crawler/migrations/0013_alter_monitor_last_notified_alter_node_entry_date.py
 create mode 100644 crawler/migrations/0014_node_last_seen.py
 create mode 100644 crawler/migrations/0015_alter_node_last_seen.py
 create mode 100644 crawler/migrations/0016_alter_monitor_last_notified.py
 create mode 100644 crawler/migrations/0017_alter_monitor_last_notified.py

diff --git a/crawler/migrations/0007_alter_monitor_notify.py b/crawler/migrations/0007_alter_monitor_notify.py
new file mode 100644
index 0000000..3a522bc
--- /dev/null
+++ b/crawler/migrations/0007_alter_monitor_notify.py
@@ -0,0 +1,18 @@
+# Generated by Django 4.2.7 on 2023-12-10 16:29
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0006_alter_monitor_notify'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='monitor',
+            name='notify',
+            field=models.BooleanField(default=True),
+        ),
+    ]
diff --git a/crawler/migrations/0008_monitor_notify_count_monitor_status_change.py b/crawler/migrations/0008_monitor_notify_count_monitor_status_change.py
new file mode 100644
index 0000000..61fcc05
--- /dev/null
+++ b/crawler/migrations/0008_monitor_notify_count_monitor_status_change.py
@@ -0,0 +1,23 @@
+# Generated by Django 4.2.7 on 2023-12-12 12:35
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0007_alter_monitor_notify'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='monitor',
+            name='notify_count',
+            field=models.PositiveIntegerField(default=0),
+        ),
+        migrations.AddField(
+            model_name='monitor',
+            name='status_change',
+            field=models.BooleanField(default=False),
+        ),
+    ]
diff --git a/crawler/migrations/0009_remove_monitor_status_change_monitor_last_notified.py b/crawler/migrations/0009_remove_monitor_status_change_monitor_last_notified.py
new file mode 100644
index 0000000..5355191
--- /dev/null
+++ b/crawler/migrations/0009_remove_monitor_status_change_monitor_last_notified.py
@@ -0,0 +1,24 @@
+# Generated by Django 4.2.7 on 2023-12-12 20:44
+
+from django.db import migrations, models
+import django.utils.timezone
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0008_monitor_notify_count_monitor_status_change'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='monitor',
+            name='status_change',
+        ),
+        migrations.AddField(
+            model_name='monitor',
+            name='last_notified',
+            field=models.DateField(auto_now_add=True, default=django.utils.timezone.now),
+            preserve_default=False,
+        ),
+    ]
diff --git a/crawler/migrations/0010_userprofile.py b/crawler/migrations/0010_userprofile.py
new file mode 100644
index 0000000..593743b
--- /dev/null
+++ b/crawler/migrations/0010_userprofile.py
@@ -0,0 +1,25 @@
+# Generated by Django 4.2.7 on 2023-12-13 06:10
+
+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),
+        ('crawler', '0009_remove_monitor_status_change_monitor_last_notified'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='UserProfile',
+            fields=[
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('max_notifiekation_intervall', models.PositiveIntegerField(default=2)),
+                ('days_between_notifikation', models.PositiveIntegerField(default=1)),
+                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
+            ],
+        ),
+    ]
diff --git a/crawler/migrations/0011_rename_days_between_notifikation_userprofile_days_between_notification_and_more.py b/crawler/migrations/0011_rename_days_between_notifikation_userprofile_days_between_notification_and_more.py
new file mode 100644
index 0000000..7c7cfd3
--- /dev/null
+++ b/crawler/migrations/0011_rename_days_between_notifikation_userprofile_days_between_notification_and_more.py
@@ -0,0 +1,23 @@
+# Generated by Django 4.2.7 on 2023-12-13 08:33
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0010_userprofile'),
+    ]
+
+    operations = [
+        migrations.RenameField(
+            model_name='userprofile',
+            old_name='days_between_notifikation',
+            new_name='days_between_notification',
+        ),
+        migrations.RenameField(
+            model_name='userprofile',
+            old_name='max_notifiekation_intervall',
+            new_name='max_notification_interval',
+        ),
+    ]
diff --git a/crawler/migrations/0012_alter_node_entry_date.py b/crawler/migrations/0012_alter_node_entry_date.py
new file mode 100644
index 0000000..fff4528
--- /dev/null
+++ b/crawler/migrations/0012_alter_node_entry_date.py
@@ -0,0 +1,18 @@
+# Generated by Django 4.2.7 on 2023-12-13 09:12
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0011_rename_days_between_notifikation_userprofile_days_between_notification_and_more'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='node',
+            name='entry_date',
+            field=models.DateField(),
+        ),
+    ]
diff --git a/crawler/migrations/0013_alter_monitor_last_notified_alter_node_entry_date.py b/crawler/migrations/0013_alter_monitor_last_notified_alter_node_entry_date.py
new file mode 100644
index 0000000..9cefdef
--- /dev/null
+++ b/crawler/migrations/0013_alter_monitor_last_notified_alter_node_entry_date.py
@@ -0,0 +1,23 @@
+# Generated by Django 4.2.7 on 2023-12-13 09:17
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0012_alter_node_entry_date'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='monitor',
+            name='last_notified',
+            field=models.DateField(),
+        ),
+        migrations.AlterField(
+            model_name='node',
+            name='entry_date',
+            field=models.DateField(auto_now_add=True),
+        ),
+    ]
diff --git a/crawler/migrations/0014_node_last_seen.py b/crawler/migrations/0014_node_last_seen.py
new file mode 100644
index 0000000..90ec3c7
--- /dev/null
+++ b/crawler/migrations/0014_node_last_seen.py
@@ -0,0 +1,20 @@
+# Generated by Django 4.2.7 on 2023-12-13 17:40
+
+import datetime
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0013_alter_monitor_last_notified_alter_node_entry_date'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='node',
+            name='last_seen',
+            field=models.DateField(default=datetime.datetime(2023, 12, 13, 17, 40, 18, 724440, tzinfo=datetime.timezone.utc)),
+            preserve_default=False,
+        ),
+    ]
diff --git a/crawler/migrations/0015_alter_node_last_seen.py b/crawler/migrations/0015_alter_node_last_seen.py
new file mode 100644
index 0000000..708a5cd
--- /dev/null
+++ b/crawler/migrations/0015_alter_node_last_seen.py
@@ -0,0 +1,18 @@
+# Generated by Django 4.2.7 on 2023-12-13 18:08
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0014_node_last_seen'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='node',
+            name='last_seen',
+            field=models.DateTimeField(),
+        ),
+    ]
diff --git a/crawler/migrations/0016_alter_monitor_last_notified.py b/crawler/migrations/0016_alter_monitor_last_notified.py
new file mode 100644
index 0000000..be430ce
--- /dev/null
+++ b/crawler/migrations/0016_alter_monitor_last_notified.py
@@ -0,0 +1,18 @@
+# Generated by Django 4.2.7 on 2023-12-13 20:16
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0015_alter_node_last_seen'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='monitor',
+            name='last_notified',
+            field=models.DateField(blank=True),
+        ),
+    ]
diff --git a/crawler/migrations/0017_alter_monitor_last_notified.py b/crawler/migrations/0017_alter_monitor_last_notified.py
new file mode 100644
index 0000000..812ba2e
--- /dev/null
+++ b/crawler/migrations/0017_alter_monitor_last_notified.py
@@ -0,0 +1,18 @@
+# Generated by Django 4.2.7 on 2023-12-13 20:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('crawler', '0016_alter_monitor_last_notified'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='monitor',
+            name='last_notified',
+            field=models.DateField(blank=True, null=True),
+        ),
+    ]
-- 
GitLab