1 # -*- coding: utf-8 -*-
3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
8 class Migration(SchemaMigration):
10 def forwards(self, orm):
11 # Adding model 'PictureArea'
12 db.create_table(u'picture_picturearea', (
13 (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('picture', self.gf('django.db.models.fields.related.ForeignKey')(related_name='areas', to=orm['picture.Picture'])),
15 ('area', self.gf('jsonfield.fields.JSONField')(default={})),
16 ('kind', self.gf('django.db.models.fields.CharField')(max_length=10, db_index=True)),
18 db.send_create_signal(u'picture', ['PictureArea'])
20 # Deleting field 'Picture.areas'
21 db.delete_column(u'picture_picture', 'areas')
23 # Adding field 'Picture.areas_json'
24 db.add_column(u'picture_picture', 'areas_json',
25 self.gf('jsonfield.fields.JSONField')(default={}),
29 def backwards(self, orm):
30 # Deleting model 'PictureArea'
31 db.delete_table(u'picture_picturearea')
33 # Adding field 'Picture.areas'
34 db.add_column(u'picture_picture', 'areas',
35 self.gf('jsonfield.fields.JSONField')(default={}),
38 # Deleting field 'Picture.areas_json'
39 db.delete_column(u'picture_picture', 'areas_json')
44 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Picture'},
45 'areas_json': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
46 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
47 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
48 'culturepl_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
49 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
50 'height': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
51 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
52 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
53 'image_file': ('sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),
54 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'}),
55 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
56 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
57 'width': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
58 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
59 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'})
61 u'picture.picturearea': {
62 'Meta': {'object_name': 'PictureArea'},
63 'area': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
64 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
65 'kind': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_index': 'True'}),
66 'picture': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'areas'", 'to': u"orm['picture.Picture']"})
70 complete_apps = ['picture']