6ac0f5487b2d22acbf94b26dd648a792821d2d64
[wolnelektury.git] / apps / api / migrations / 0001_initial.py
1 # encoding: 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 class Migration(SchemaMigration):
8
9     def forwards(self, orm):
10         
11         # Adding model 'Deleted'
12         db.create_table('api_deleted', (
13             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14             ('object_id', self.gf('django.db.models.fields.IntegerField')()),
15             ('type', self.gf('django.db.models.fields.CharField')(max_length='50')),
16             ('created_at', self.gf('django.db.models.fields.DateTimeField')()),
17             ('deleted_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
18         ))
19         db.send_create_signal('api', ['Deleted'])
20
21         # Adding unique constraint on 'Deleted', fields ['type', 'object_id']
22         db.create_unique('api_deleted', ['type', 'object_id'])
23
24
25     def backwards(self, orm):
26         
27         # Removing unique constraint on 'Deleted', fields ['type', 'object_id']
28         db.delete_unique('api_deleted', ['type', 'object_id'])
29
30         # Deleting model 'Deleted'
31         db.delete_table('api_deleted')
32
33
34     models = {
35         'api.deleted': {
36             'Meta': {'unique_together': "(('type', 'object_id'),)", 'object_name': 'Deleted'},
37             'created_at': ('django.db.models.fields.DateTimeField', [], {}),
38             'deleted_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
39             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
40             'object_id': ('django.db.models.fields.IntegerField', [], {}),
41             'type': ('django.db.models.fields.CharField', [], {'max_length': "'50'"})
42         }
43     }
44
45     complete_apps = ['api']