1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #13647: Squash all migrations prior to v3.7 (#14853)

* Regenerate pre-v3.7 migrations

* Annotate replaced migrations

* Rename dependencies; remove FeatureQuery references

* Add missed replacement
This commit is contained in:
Jeremy Stretch
2024-01-19 13:55:22 -05:00
committed by GitHub
parent ef5e10d360
commit 874685fd6f
190 changed files with 4367 additions and 9157 deletions

View File

@@ -1,9 +1,8 @@
# Generated by Django 4.1.5 on 2023-02-02 02:37
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
import extras.utils
import utilities.json
@@ -12,10 +11,39 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('extras', '0084_staging'),
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='AutoSyncRecord',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('object_id', models.PositiveBigIntegerField()),
],
options={
'verbose_name': 'auto sync record',
'verbose_name_plural': 'auto sync records',
},
),
migrations.CreateModel(
name='DataFile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('created', models.DateTimeField(auto_now_add=True)),
('last_updated', models.DateTimeField(editable=False)),
('path', models.CharField(editable=False, max_length=1000)),
('size', models.PositiveIntegerField(editable=False)),
('hash', models.CharField(editable=False, max_length=64, validators=[django.core.validators.RegexValidator(message='Length must be 64 hexadecimal characters.', regex='^[0-9a-f]{64}$')])),
('data', models.BinaryField()),
],
options={
'verbose_name': 'data file',
'verbose_name_plural': 'data files',
'ordering': ('source', 'path'),
},
),
migrations.CreateModel(
name='DataSource',
fields=[
@@ -33,51 +61,54 @@ class Migration(migrations.Migration):
('ignore_rules', models.TextField(blank=True)),
('parameters', models.JSONField(blank=True, null=True)),
('last_synced', models.DateTimeField(blank=True, editable=False, null=True)),
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
],
options={
'verbose_name': 'data source',
'verbose_name_plural': 'data sources',
'ordering': ('name',),
},
),
migrations.CreateModel(
name='DataFile',
name='ManagedFile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('data_path', models.CharField(blank=True, editable=False, max_length=1000)),
('auto_sync_enabled', models.BooleanField(default=False)),
('data_synced', models.DateTimeField(blank=True, editable=False, null=True)),
('created', models.DateTimeField(auto_now_add=True)),
('last_updated', models.DateTimeField(editable=False)),
('path', models.CharField(editable=False, max_length=1000)),
('size', models.PositiveIntegerField(editable=False)),
('hash', models.CharField(editable=False, max_length=64, validators=[django.core.validators.RegexValidator(message='Length must be 64 hexadecimal characters.', regex='^[0-9a-f]{64}$')])),
('data', models.BinaryField()),
('source', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='datafiles', to='core.datasource')),
('last_updated', models.DateTimeField(blank=True, editable=False, null=True)),
('file_root', models.CharField(max_length=1000)),
('file_path', models.FilePathField(editable=False)),
('data_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.datafile')),
('data_source', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='core.datasource')),
],
options={
'ordering': ('source', 'path'),
'verbose_name': 'managed file',
'verbose_name_plural': 'managed files',
'ordering': ('file_root', 'file_path'),
},
),
migrations.AddConstraint(
model_name='datafile',
constraint=models.UniqueConstraint(fields=('source', 'path'), name='core_datafile_unique_source_path'),
),
migrations.AddIndex(
model_name='datafile',
index=models.Index(fields=['source', 'path'], name='core_datafile_source_path'),
),
migrations.CreateModel(
name='AutoSyncRecord',
name='Job',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
('object_id', models.PositiveBigIntegerField()),
('datafile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='core.datafile')),
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
('object_id', models.PositiveBigIntegerField(blank=True, null=True)),
('name', models.CharField(max_length=200)),
('created', models.DateTimeField(auto_now_add=True)),
('scheduled', models.DateTimeField(blank=True, null=True)),
('interval', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
('started', models.DateTimeField(blank=True, null=True)),
('completed', models.DateTimeField(blank=True, null=True)),
('status', models.CharField(default='pending', max_length=30)),
('data', models.JSONField(blank=True, null=True)),
('job_id', models.UUIDField(unique=True)),
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobs', to='contenttypes.contenttype')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddIndex(
model_name='autosyncrecord',
index=models.Index(fields=['object_type', 'object_id'], name='core_autosy_object__c17bac_idx'),
),
migrations.AddConstraint(
model_name='autosyncrecord',
constraint=models.UniqueConstraint(fields=('object_type', 'object_id'), name='core_autosyncrecord_object'),
options={
'verbose_name': 'job',
'verbose_name_plural': 'jobs',
'ordering': ['-created'],
},
),
]