From 97c93ff0e251eb672d6f945ab91834551cc3904b Mon Sep 17 00:00:00 2001 From: Marcus Furlong Date: Mon, 11 Dec 2023 22:33:26 -0500 Subject: [PATCH] add migrations from v2 --- arch/migrations/0001_initial.py | 36 +++++++ arch/migrations/__init__.py | 0 domains/migrations/0001_initial.py | 21 ++++ domains/migrations/__init__.py | 0 hosts/migrations/0001_initial.py | 47 +++++++++ hosts/migrations/0002_initial.py | 60 ++++++++++++ hosts/migrations/0003_host_modules.py | 19 ++++ hosts/migrations/__init__.py | 0 modules/migrations/0001_initial.py | 36 +++++++ modules/migrations/__init__.py | 0 operatingsystems/migrations/0001_initial.py | 38 ++++++++ operatingsystems/migrations/0002_initial.py | 27 ++++++ operatingsystems/migrations/__init__.py | 0 packages/migrations/0001_initial.py | 101 ++++++++++++++++++++ packages/migrations/__init__.py | 0 reports/migrations/0001_initial.py | 41 ++++++++ reports/migrations/0002_report_modules.py | 18 ++++ reports/migrations/__init__.py | 0 repos/migrations/0001_initial.py | 69 +++++++++++++ repos/migrations/__init__.py | 0 20 files changed, 513 insertions(+) create mode 100644 arch/migrations/0001_initial.py create mode 100644 arch/migrations/__init__.py create mode 100644 domains/migrations/0001_initial.py create mode 100644 domains/migrations/__init__.py create mode 100644 hosts/migrations/0001_initial.py create mode 100644 hosts/migrations/0002_initial.py create mode 100644 hosts/migrations/0003_host_modules.py create mode 100644 hosts/migrations/__init__.py create mode 100644 modules/migrations/0001_initial.py create mode 100644 modules/migrations/__init__.py create mode 100644 operatingsystems/migrations/0001_initial.py create mode 100644 operatingsystems/migrations/0002_initial.py create mode 100644 operatingsystems/migrations/__init__.py create mode 100644 packages/migrations/0001_initial.py create mode 100644 packages/migrations/__init__.py create mode 100644 reports/migrations/0001_initial.py create mode 100644 reports/migrations/0002_report_modules.py create mode 100644 reports/migrations/__init__.py create mode 100644 repos/migrations/0001_initial.py create mode 100644 repos/migrations/__init__.py diff --git a/arch/migrations/0001_initial.py b/arch/migrations/0001_initial.py new file mode 100644 index 00000000..eef3a114 --- /dev/null +++ b/arch/migrations/0001_initial.py @@ -0,0 +1,36 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='MachineArchitecture', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ], + options={ + 'verbose_name': 'Machine Architecture', + 'abstract': False, + }, + ), + migrations.CreateModel( + name='PackageArchitecture', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ], + options={ + 'verbose_name': 'Package Architecture', + 'abstract': False, + }, + ), + ] diff --git a/arch/migrations/__init__.py b/arch/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/domains/migrations/0001_initial.py b/domains/migrations/0001_initial.py new file mode 100644 index 00000000..473fab19 --- /dev/null +++ b/domains/migrations/0001_initial.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Domain', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ], + ), + ] diff --git a/domains/migrations/__init__.py b/domains/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hosts/migrations/0001_initial.py b/hosts/migrations/0001_initial.py new file mode 100644 index 00000000..f8f8d45c --- /dev/null +++ b/hosts/migrations/0001_initial.py @@ -0,0 +1,47 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:15 + +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import tagging.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Host', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('hostname', models.CharField(max_length=255, unique=True)), + ('ipaddress', models.GenericIPAddressField()), + ('reversedns', models.CharField(blank=True, max_length=255, null=True)), + ('check_dns', models.BooleanField(default=False)), + ('kernel', models.CharField(max_length=255)), + ('lastreport', models.DateTimeField()), + ('reboot_required', models.BooleanField(default=False)), + ('host_repos_only', models.BooleanField(default=True)), + ('tags', tagging.fields.TagField(blank=True, max_length=255)), + ('updated_at', models.DateTimeField(default=django.utils.timezone.now)), + ], + options={ + 'verbose_name': 'Host', + 'verbose_name_plural': 'Hosts', + 'ordering': ('hostname',), + }, + ), + migrations.CreateModel( + name='HostRepo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('enabled', models.BooleanField(default=True)), + ('priority', models.IntegerField(default=0)), + ('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hosts.host')), + ], + ), + ] diff --git a/hosts/migrations/0002_initial.py b/hosts/migrations/0002_initial.py new file mode 100644 index 00000000..cc59a70e --- /dev/null +++ b/hosts/migrations/0002_initial.py @@ -0,0 +1,60 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:15 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('domains', '0001_initial'), + ('packages', '0001_initial'), + ('arch', '0001_initial'), + ('operatingsystems', '0002_initial'), + ('hosts', '0001_initial'), + ('repos', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='hostrepo', + name='repo', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='repos.repository'), + ), + migrations.AddField( + model_name='host', + name='arch', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='arch.machinearchitecture'), + ), + migrations.AddField( + model_name='host', + name='domain', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='domains.domain'), + ), + migrations.AddField( + model_name='host', + name='os', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='operatingsystems.os'), + ), + migrations.AddField( + model_name='host', + name='packages', + field=models.ManyToManyField(blank=True, to='packages.Package'), + ), + migrations.AddField( + model_name='host', + name='repos', + field=models.ManyToManyField(blank=True, through='hosts.HostRepo', to='repos.Repository'), + ), + migrations.AddField( + model_name='host', + name='updates', + field=models.ManyToManyField(blank=True, to='packages.PackageUpdate'), + ), + migrations.AlterUniqueTogether( + name='hostrepo', + unique_together={('host', 'repo')}, + ), + ] diff --git a/hosts/migrations/0003_host_modules.py b/hosts/migrations/0003_host_modules.py new file mode 100644 index 00000000..98de42dc --- /dev/null +++ b/hosts/migrations/0003_host_modules.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('modules', '0001_initial'), + ('hosts', '0002_initial'), + ] + + operations = [ + migrations.AddField( + model_name='host', + name='modules', + field=models.ManyToManyField(blank=True, to='modules.Module'), + ), + ] diff --git a/hosts/migrations/__init__.py b/hosts/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/modules/migrations/0001_initial.py b/modules/migrations/0001_initial.py new file mode 100644 index 00000000..12a8e278 --- /dev/null +++ b/modules/migrations/0001_initial.py @@ -0,0 +1,36 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:17 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('packages', '0001_initial'), + ('arch', '0001_initial'), + ('repos', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Module', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ('stream', models.CharField(max_length=255, unique=True)), + ('version', models.CharField(max_length=255)), + ('context', models.CharField(max_length=255, unique=True)), + ('arch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='arch.packagearchitecture')), + ('packages', models.ManyToManyField(blank=True, to='packages.Package')), + ('repo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='repos.repository')), + ], + options={ + 'verbose_name': 'Module', + 'verbose_name_plural': 'Modules', + 'ordering': ('name',), + }, + ), + ] diff --git a/modules/migrations/__init__.py b/modules/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/operatingsystems/migrations/0001_initial.py b/operatingsystems/migrations/0001_initial.py new file mode 100644 index 00000000..a5ec29d2 --- /dev/null +++ b/operatingsystems/migrations/0001_initial.py @@ -0,0 +1,38 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='OS', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ], + options={ + 'verbose_name': 'Operating System', + 'verbose_name_plural': 'Operating Systems', + 'ordering': ('name',), + }, + ), + migrations.CreateModel( + name='OSGroup', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ], + options={ + 'verbose_name': 'Operating System Group', + 'verbose_name_plural': 'Operating System Groups', + 'ordering': ('name',), + }, + ), + ] diff --git a/operatingsystems/migrations/0002_initial.py b/operatingsystems/migrations/0002_initial.py new file mode 100644 index 00000000..517a3f9a --- /dev/null +++ b/operatingsystems/migrations/0002_initial.py @@ -0,0 +1,27 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:15 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('operatingsystems', '0001_initial'), + ('repos', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='osgroup', + name='repos', + field=models.ManyToManyField(blank=True, to='repos.Repository'), + ), + migrations.AddField( + model_name='os', + name='osgroup', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='operatingsystems.osgroup'), + ), + ] diff --git a/operatingsystems/migrations/__init__.py b/operatingsystems/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/packages/migrations/0001_initial.py b/packages/migrations/0001_initial.py new file mode 100644 index 00000000..07e7bcb0 --- /dev/null +++ b/packages/migrations/0001_initial.py @@ -0,0 +1,101 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:15 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('arch', '0001_initial'), + ('operatingsystems', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='PackageString', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('version', models.CharField(max_length=255)), + ('epoch', models.CharField(blank=True, max_length=255, null=True)), + ('release', models.CharField(blank=True, max_length=255, null=True)), + ('arch', models.CharField(max_length=255)), + ('packagetype', models.CharField(blank=True, max_length=1, null=True)), + ('description', models.TextField(blank=True, null=True)), + ('url', models.URLField(blank=True, max_length=255, null=True)), + ], + options={ + 'managed': False, + }, + ), + migrations.CreateModel( + name='ErratumReference', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('url', models.URLField(max_length=255)), + ], + ), + migrations.CreateModel( + name='PackageName', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ], + options={ + 'verbose_name': 'Package', + 'verbose_name_plural': 'Packages', + 'ordering': ('name',), + }, + ), + migrations.CreateModel( + name='Package', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('epoch', models.CharField(blank=True, max_length=255, null=True)), + ('version', models.CharField(max_length=255)), + ('release', models.CharField(blank=True, max_length=255, null=True)), + ('packagetype', models.CharField(blank=True, choices=[('R', 'rpm'), ('D', 'deb'), ('A', 'arch'), ('U', 'unknown')], max_length=1, null=True)), + ('description', models.TextField(blank=True, null=True)), + ('url', models.URLField(blank=True, max_length=255, null=True)), + ('arch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='arch.packagearchitecture')), + ('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='packages.packagename')), + ], + options={ + 'ordering': ('name', 'epoch', 'version', 'release', 'arch'), + 'unique_together': {('name', 'epoch', 'version', 'release', 'arch', 'packagetype')}, + }, + ), + migrations.CreateModel( + name='Erratum', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('etype', models.CharField(max_length=255)), + ('issue_date', models.DateTimeField()), + ('synopsis', models.CharField(max_length=255)), + ('arches', models.ManyToManyField(blank=True, to='arch.MachineArchitecture')), + ('packages', models.ManyToManyField(blank=True, to='packages.Package')), + ('references', models.ManyToManyField(blank=True, to='packages.ErratumReference')), + ('releases', models.ManyToManyField(blank=True, to='operatingsystems.OSGroup')), + ], + options={ + 'verbose_name': 'Erratum', + 'verbose_name_plural': 'Errata', + }, + ), + migrations.CreateModel( + name='PackageUpdate', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('security', models.BooleanField(default=False)), + ('newpackage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='newpackage', to='packages.package')), + ('oldpackage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='oldpackage', to='packages.package')), + ], + options={ + 'unique_together': {('oldpackage', 'newpackage', 'security')}, + }, + ), + ] diff --git a/packages/migrations/__init__.py b/packages/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/reports/migrations/0001_initial.py b/reports/migrations/0001_initial.py new file mode 100644 index 00000000..7daa87bc --- /dev/null +++ b/reports/migrations/0001_initial.py @@ -0,0 +1,41 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:16 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Report', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(auto_now_add=True)), + ('accessed', models.DateTimeField(auto_now_add=True)), + ('host', models.CharField(max_length=255, null=True)), + ('domain', models.CharField(max_length=255, null=True)), + ('tags', models.CharField(default='', max_length=255, null=True)), + ('kernel', models.CharField(max_length=255, null=True)), + ('arch', models.CharField(max_length=255, null=True)), + ('os', models.CharField(max_length=255, null=True)), + ('report_ip', models.GenericIPAddressField(blank=True, null=True)), + ('protocol', models.CharField(max_length=255, null=True)), + ('useragent', models.CharField(max_length=255, null=True)), + ('processed', models.BooleanField(default=False)), + ('packages', models.TextField(blank=True, null=True)), + ('sec_updates', models.TextField(blank=True, null=True)), + ('bug_updates', models.TextField(blank=True, null=True)), + ('repos', models.TextField(blank=True, null=True)), + ('reboot', models.TextField(blank=True, null=True)), + ], + options={ + 'verbose_name_plural': 'Reports', + 'ordering': ('-created',), + }, + ), + ] diff --git a/reports/migrations/0002_report_modules.py b/reports/migrations/0002_report_modules.py new file mode 100644 index 00000000..dad9082d --- /dev/null +++ b/reports/migrations/0002_report_modules.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('reports', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='report', + name='modules', + field=models.TextField(blank=True, null=True), + ), + ] diff --git a/reports/migrations/__init__.py b/reports/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/repos/migrations/0001_initial.py b/repos/migrations/0001_initial.py new file mode 100644 index 00000000..a99f6878 --- /dev/null +++ b/repos/migrations/0001_initial.py @@ -0,0 +1,69 @@ +# Generated by Django 3.2.19 on 2023-12-11 22:15 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('arch', '0001_initial'), + ('packages', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Mirror', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('url', models.CharField(max_length=255, unique=True)), + ('last_access_ok', models.BooleanField(default=False)), + ('file_checksum', models.CharField(blank=True, max_length=255, null=True)), + ('timestamp', models.DateTimeField(auto_now_add=True)), + ('mirrorlist', models.BooleanField(default=False)), + ('enabled', models.BooleanField(default=True)), + ('refresh', models.BooleanField(default=True)), + ('fail_count', models.IntegerField(default=0)), + ], + options={ + 'verbose_name_plural': 'Mirrors', + }, + ), + migrations.CreateModel( + name='Repository', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ('security', models.BooleanField(default=False)), + ('repotype', models.CharField(choices=[('R', 'rpm'), ('D', 'deb'), ('A', 'arch')], max_length=1)), + ('enabled', models.BooleanField(default=True)), + ('repo_id', models.CharField(blank=True, max_length=255, null=True)), + ('auth_required', models.BooleanField(default=False)), + ('arch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='arch.machinearchitecture')), + ], + options={ + 'verbose_name_plural': 'Repositories', + }, + ), + migrations.CreateModel( + name='MirrorPackage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('enabled', models.BooleanField(default=True)), + ('mirror', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='repos.mirror')), + ('package', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='packages.package')), + ], + ), + migrations.AddField( + model_name='mirror', + name='packages', + field=models.ManyToManyField(blank=True, through='repos.MirrorPackage', to='packages.Package'), + ), + migrations.AddField( + model_name='mirror', + name='repo', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='repos.repository'), + ), + ] diff --git a/repos/migrations/__init__.py b/repos/migrations/__init__.py new file mode 100644 index 00000000..e69de29b