From 4357e30dc54398a9dbb2e94d1de9e037eed9ffef Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Mon, 5 Dec 2016 10:51:52 +0000 Subject: [PATCH] Increase the max_length of CodeType.code & NameType.code This is because the name of the 'local-authority-eng' is longer than the previous 10 characters allowed. --- mapit/migrations/0003_auto_20161205_1050.py | 25 +++++++++++++++++++++ mapit/models.py | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 mapit/migrations/0003_auto_20161205_1050.py diff --git a/mapit/migrations/0003_auto_20161205_1050.py b/mapit/migrations/0003_auto_20161205_1050.py new file mode 100644 index 00000000..8520a82c --- /dev/null +++ b/mapit/migrations/0003_auto_20161205_1050.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.1 on 2016-12-05 14:19 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mapit', '0002_auto_20141218_1615'), + ] + + operations = [ + migrations.AlterField( + model_name='codetype', + name='code', + field=models.CharField(help_text="A unique code, eg 'ons' or 'unit_id'", max_length=500, unique=True), + ), + migrations.AlterField( + model_name='nametype', + name='code', + field=models.CharField(help_text="A unique code to identify this type of name: eg 'english' or 'iso'", max_length=500, unique=True), + ), + ] diff --git a/mapit/models.py b/mapit/models.py index 6e9e6144..1d477948 100644 --- a/mapit/models.py +++ b/mapit/models.py @@ -346,7 +346,7 @@ class NameType(models.Model): # and displayed in the alternative names section. code = models.CharField( - max_length=10, unique=True, help_text="A unique code to identify this type of name: eg 'english' or 'iso'") + max_length=500, unique=True, help_text="A unique code to identify this type of name: eg 'english' or 'iso'") description = models.CharField( max_length=200, blank=True, help_text="The name of this type of name, eg 'English' or 'ISO Standard'") objects = models.Manager() @@ -386,7 +386,7 @@ class CodeType(models.Model): # This could be extended to a more generic data store of information on an # object, perhaps. - code = models.CharField(max_length=10, unique=True, help_text="A unique code, eg 'ons' or 'unit_id'") + code = models.CharField(max_length=500, unique=True, help_text="A unique code, eg 'ons' or 'unit_id'") description = models.CharField( max_length=200, blank=True, help_text="The name of the code, eg 'Office of National Statitics' or 'Ordnance Survey ID'")