datatracker/ietf/community/migrations/0005_1_del_docs_m2m_table.py
Henrik Levkowetz 815602351f This is a series of 50 migrations that changes the Document and DocAlias
primary keys from character strings to integers, and makes corresponding code
changes.

This was prompted by database limitations discovered when trying to make
DocAlias use a m2m document field; with 255 long strings as primary keys for
Document and DocAlias this violated the MySQL database limitations.

Changing the primary keys to integers should also improve efficiency.  

Due to the data migrations which create the new integer primary keys and adds
corresponding integer foreign keys matching the previous string foreign keys
in all tables having foreign keys to Document and DocAlias, some of these
migrations take a long time.  The total set of migrations are expected to have
a runtime on the order of 2 hours.
 - Legacy-Id: 16237
2019-06-10 11:32:46 +00:00

32 lines
930 B
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-22 08:15
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('community', '0004_set_document_m2m_keys'),
]
# The implementation of AlterField in Django 1.11 applies
# 'ALTER TABLE <table> MODIFY <field> ...;' in order to fix foregn keys
# to the altered field, but as it seems does _not_ fix up m2m
# intermediary tables in an equivalent manner, so here we remove and
# then recreate the m2m tables so they will have the appropriate field
# types.
operations = [
# Remove fields
migrations.RemoveField(
model_name='communitylist',
name='added_docs',
),
migrations.RemoveField(
model_name='searchrule',
name='name_contains_index',
),
]