diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2015-12-03 21:02:07 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2015-12-03 21:02:07 +0100 | 
| commit | 12476a229f1c9304751944fb0c2beda70641784f (patch) | |
| tree | d647595e4393153e68b0a415eb6aa44e42e1be8a | |
| parent | a657ca2449e804fc60ae40422cd463840813285f (diff) | |
| download | Ishtar-12476a229f1c9304751944fb0c2beda70641784f.tar.bz2 Ishtar-12476a229f1c9304751944fb0c2beda70641784f.zip  | |
Fix an old migration
| -rw-r--r-- | archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py | 45 | 
1 files changed, 17 insertions, 28 deletions
diff --git a/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py b/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py index f68da341d..f248c4c1c 100644 --- a/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py +++ b/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py @@ -9,31 +9,6 @@ class Migration(SchemaMigration):      def forwards(self, orm): -        for file in orm['archaeological_files.File'].objects.all(): -            if file.towns.count() == 1: -                file.main_town = file.towns.all()[0] -                file.save() - -        for file in orm['archaeological_files.File'].objects.all(): -            address_comp = file.address_complement.strip() -            if not address_comp: -                continue -            address = file.address.strip() -            if address: -                address += """ -""" -            address += address_comp -            file.address = address -            file.save() - -        # Changing field 'SaisineType.txt_idx' -        db.alter_column('archaeological_files_saisinetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)) - -        # Changing field 'FileType.txt_idx' -        db.alter_column('archaeological_files_filetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)) -        # Deleting field 'File.address_complement' -        db.delete_column('archaeological_files_file', 'address_complement') -          # Adding field 'File.raw_general_contractor'          db.add_column('archaeological_files_file', 'raw_general_contractor',                        self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True), @@ -59,9 +34,6 @@ class Migration(SchemaMigration):                        self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True),                        keep_default=False) -        # Deleting field 'HistoricalFile.address_complement' -        db.delete_column('archaeological_files_historicalfile', 'address_complement') -          # Adding field 'HistoricalFile.raw_general_contractor'          db.add_column('archaeological_files_historicalfile', 'raw_general_contractor',                        self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True), @@ -87,6 +59,23 @@ class Migration(SchemaMigration):                        self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True),                        keep_default=False) +        for file in orm['archaeological_files.File'].objects.all(): +            if file.towns.count() == 1: +                file.main_town = file.towns.all()[0] +                file.save() + +        # Changing field 'SaisineType.txt_idx' +        db.alter_column('archaeological_files_saisinetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)) + +        # Changing field 'FileType.txt_idx' +        db.alter_column('archaeological_files_filetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100)) + +        # Deleting field 'File.address_complement' +        db.delete_column('archaeological_files_file', 'address_complement') + +        # Deleting field 'HistoricalFile.address_complement' +        db.delete_column('archaeological_files_historicalfile', 'address_complement') +          # Changing field 'PermitType.txt_idx'          db.alter_column('archaeological_files_permittype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))  | 
