From 0b610c6c1d9dfce4c2a5b8592629f5e3deed5890 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 1 Feb 2023 15:29:06 -0500 Subject: [PATCH] Clean up migrations --- netbox/core/migrations/0001_initial.py | 14 +++++---- ...2_remove_datasource_git_branch_and_more.py | 30 ------------------- ...ource_custom_field_data_datasource_tags.py | 26 ---------------- .../migrations/0004_datasource_comments.py | 18 ----------- 4 files changed, 9 insertions(+), 79 deletions(-) delete mode 100644 netbox/core/migrations/0002_remove_datasource_git_branch_and_more.py delete mode 100644 netbox/core/migrations/0003_datasource_custom_field_data_datasource_tags.py delete mode 100644 netbox/core/migrations/0004_datasource_comments.py diff --git a/netbox/core/migrations/0001_initial.py b/netbox/core/migrations/0001_initial.py index 900b7393a..79abd5971 100644 --- a/netbox/core/migrations/0001_initial.py +++ b/netbox/core/migrations/0001_initial.py @@ -1,8 +1,10 @@ -# Generated by Django 4.1.5 on 2023-01-27 18:15 +# Generated by Django 4.1.5 on 2023-02-01 20:27 import django.core.validators from django.db import migrations, models import django.db.models.deletion +import taggit.managers +import utilities.json class Migration(migrations.Migration): @@ -10,6 +12,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ + ('extras', '0084_staging'), ] operations = [ @@ -19,17 +22,18 @@ class Migration(migrations.Migration): ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)), ('created', models.DateTimeField(auto_now_add=True, null=True)), ('last_updated', models.DateTimeField(auto_now=True, null=True)), + ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)), + ('description', models.CharField(blank=True, max_length=200)), + ('comments', models.TextField(blank=True)), ('name', models.CharField(max_length=100, unique=True)), ('type', models.CharField(default='local', max_length=50)), ('url', models.CharField(max_length=200)), ('status', models.CharField(default='new', editable=False, max_length=50)), ('enabled', models.BooleanField(default=True)), - ('description', models.CharField(blank=True, max_length=200)), - ('git_branch', models.CharField(blank=True, max_length=100)), ('ignore_rules', models.TextField(blank=True)), - ('username', models.CharField(blank=True, max_length=100)), - ('password', models.CharField(blank=True, max_length=100)), + ('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={ 'ordering': ('name',), diff --git a/netbox/core/migrations/0002_remove_datasource_git_branch_and_more.py b/netbox/core/migrations/0002_remove_datasource_git_branch_and_more.py deleted file mode 100644 index 09e7e4736..000000000 --- a/netbox/core/migrations/0002_remove_datasource_git_branch_and_more.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 4.1.5 on 2023-01-30 21:49 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='datasource', - name='git_branch', - ), - migrations.RemoveField( - model_name='datasource', - name='password', - ), - migrations.RemoveField( - model_name='datasource', - name='username', - ), - migrations.AddField( - model_name='datasource', - name='parameters', - field=models.JSONField(blank=True, null=True), - ), - ] diff --git a/netbox/core/migrations/0003_datasource_custom_field_data_datasource_tags.py b/netbox/core/migrations/0003_datasource_custom_field_data_datasource_tags.py deleted file mode 100644 index 5011e2e6a..000000000 --- a/netbox/core/migrations/0003_datasource_custom_field_data_datasource_tags.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 4.1.5 on 2023-02-01 20:04 - -from django.db import migrations, models -import taggit.managers -import utilities.json - - -class Migration(migrations.Migration): - - dependencies = [ - ('extras', '0084_staging'), - ('core', '0002_remove_datasource_git_branch_and_more'), - ] - - operations = [ - migrations.AddField( - model_name='datasource', - name='custom_field_data', - field=models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder), - ), - migrations.AddField( - model_name='datasource', - name='tags', - field=taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag'), - ), - ] diff --git a/netbox/core/migrations/0004_datasource_comments.py b/netbox/core/migrations/0004_datasource_comments.py deleted file mode 100644 index ba7459a96..000000000 --- a/netbox/core/migrations/0004_datasource_comments.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.1.5 on 2023-02-01 20:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0003_datasource_custom_field_data_datasource_tags'), - ] - - operations = [ - migrations.AddField( - model_name='datasource', - name='comments', - field=models.TextField(blank=True), - ), - ]