old_contents: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  
  from django.db import models, migrations
  from django.db.utils import ProgrammingError
  
  import django.db.models.deletion
  
  def add_file_type_if_not_exists(apps, schema_editor):
      '''
      This should run on production, but not when spinning up a new database
  
      Next time I deploy prod i will remove this migration.
      '''
  
      try:
          migrations.AddField(
              model_name='document',
              name='file_type',
              field=models.CharField(default='campaign', max_length=10),
              preserve_default=False,
          )
      except ProgrammingError:
          pass
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('rhizome', '0005_reset_sql_sequence'),
      ]
  
      operations = [
          migrations.RunPython(add_file_type_if_not_exists)
      ]
  
new_contents: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals
  
  from django.db import models, migrations
  from django.db.utils import ProgrammingError
  
  import django.db.models.deletion
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('rhizome', '0005_reset_sql_sequence'),
      ]
  
      operations = [
          migrations.AddField(
              model_name='document',
              name='file_type',
              field=models.CharField(default='campaign', max_length=10),
              preserve_default=False,
          )
      ]
  
subject: fix migration to work for existing database ( wont work on a fresh one )