fix
[prawokultury.git] / contact / migrations / 0002_auto__add_attachment.py
1 # -*- coding: utf-8 -*-
2 import datetime
3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
6
7
8 class Migration(SchemaMigration):
9
10     def forwards(self, orm):
11         # Adding model 'Attachment'
12         db.create_table('contact_attachment', (
13             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14             ('contact', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contact.Contact'])),
15             ('tag', self.gf('django.db.models.fields.CharField')(max_length=64)),
16             ('file', self.gf('django.db.models.fields.files.FileField')(max_length=100)),
17         ))
18         db.send_create_signal('contact', ['Attachment'])
19
20         # Adding index on 'Contact', fields ['form_tag']
21         db.create_index('contact_contact', ['form_tag'])
22
23
24     def backwards(self, orm):
25         # Removing index on 'Contact', fields ['form_tag']
26         db.delete_index('contact_contact', ['form_tag'])
27
28         # Deleting model 'Attachment'
29         db.delete_table('contact_attachment')
30
31
32     models = {
33         'contact.attachment': {
34             'Meta': {'object_name': 'Attachment'},
35             'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contact.Contact']"}),
36             'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
37             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
38             'tag': ('django.db.models.fields.CharField', [], {'max_length': '64'})
39         },
40         'contact.contact': {
41             'Meta': {'ordering': "('-created_at',)", 'object_name': 'Contact'},
42             'body': ('jsonfield.fields.JSONField', [], {}),
43             'contact': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
44             'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
45             'form_tag': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}),
46             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
47             'ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'})
48         }
49     }
50
51     complete_apps = ['contact']