mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
removed migration to delete taggit models
This commit is contained in:
@ -36,6 +36,10 @@ class Migration(migrations.Migration):
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.AlterIndexTogether(
|
||||
name='taggeditem',
|
||||
index_together={('content_type', 'object_id')},
|
||||
),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
@ -28,6 +28,13 @@ class AppTaggitAlterModelTable(migrations.AlterModelTable):
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
"""
|
||||
Rename the tables from taggit_* to extras_*
|
||||
|
||||
Note that while we change the database state, we are not deleting the django
|
||||
model state for the taggit models. Doing so would result in makemigrations
|
||||
recreating them.
|
||||
"""
|
||||
|
||||
dependencies = [
|
||||
('taggit', '0001_initial'),
|
||||
|
@ -7,7 +7,13 @@ import utilities.fields
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0019_delete_taggit_models'),
|
||||
('extras', '0018_rename_tag_tables'),
|
||||
('circuits', '0015_custom_tag_models'),
|
||||
('dcim', '0070_custom_tag_models'),
|
||||
('ipam', '0025_custom_tag_models'),
|
||||
('secrets', '0006_custom_tag_models'),
|
||||
('tenancy', '0006_custom_tag_models'),
|
||||
('virtualization', '0009_custom_tag_models'),
|
||||
]
|
||||
|
||||
operations = [
|
@ -1,52 +0,0 @@
|
||||
# Generated by Django 2.1.4 on 2019-02-20 07:05
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class AppTaggitDeleteModel(migrations.DeleteModel):
|
||||
"""
|
||||
A special subclass of DeleteModel which hardcodes the app_label to 'taggit'
|
||||
|
||||
This is needed because the migration deals with models which belong to the taggit
|
||||
app, however because taggit is a 3rd party app, we cannot create our own migrations
|
||||
there.
|
||||
"""
|
||||
|
||||
def state_forwards(self, app_label, state):
|
||||
super().state_forwards('taggit', state)
|
||||
|
||||
def database_forwards(self, app_label, schema_editor, from_state, to_state):
|
||||
super().database_forwards('taggit', schema_editor, from_state, to_state)
|
||||
|
||||
def database_backwards(self, app_label, schema_editor, from_state, to_state):
|
||||
super().database_backwards('taggit', schema_editor, from_state, to_state)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extras', '0018_rename_tag_tables'),
|
||||
('circuits', '0015_custom_tag_models'),
|
||||
('dcim', '0070_custom_tag_models'),
|
||||
('ipam', '0025_custom_tag_models'),
|
||||
('secrets', '0006_custom_tag_models'),
|
||||
('tenancy', '0006_custom_tag_models'),
|
||||
('virtualization', '0009_custom_tag_models'),
|
||||
]
|
||||
|
||||
state_operations = [
|
||||
AppTaggitDeleteModel(
|
||||
name='Tag',
|
||||
),
|
||||
AppTaggitDeleteModel(
|
||||
name='TaggedItem',
|
||||
),
|
||||
]
|
||||
|
||||
database_operations = []
|
||||
operations = [
|
||||
migrations.SeparateDatabaseAndState(
|
||||
database_operations=None,
|
||||
state_operations=state_operations
|
||||
)
|
||||
]
|
Reference in New Issue
Block a user