3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
7 class Migration(SchemaMigration):
9 def forwards(self, orm):
11 # Adding model 'Change'
12 db.create_table('dvcs_change', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
15 ('author_desc', self.gf('django.db.models.fields.CharField')(max_length=128, null=True, blank=True)),
16 ('patch', self.gf('django.db.models.fields.TextField')(blank=True)),
17 ('tree', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['dvcs.Document'])),
18 ('revision', self.gf('django.db.models.fields.IntegerField')(db_index=True)),
19 ('parent', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='children', null=True, blank=True, to=orm['dvcs.Change'])),
20 ('merge_parent', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='merge_children', null=True, blank=True, to=orm['dvcs.Change'])),
21 ('description', self.gf('django.db.models.fields.TextField')(default='', blank=True)),
22 ('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, db_index=True)),
24 db.send_create_signal('dvcs', ['Change'])
26 # Adding unique constraint on 'Change', fields ['tree', 'revision']
27 db.create_unique('dvcs_change', ['tree_id', 'revision'])
29 # Adding model 'Document'
30 db.create_table('dvcs_document', (
31 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
32 ('creator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
33 ('head', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['dvcs.Change'], null=True, blank=True)),
35 db.send_create_signal('dvcs', ['Document'])
38 def backwards(self, orm):
40 # Removing unique constraint on 'Change', fields ['tree', 'revision']
41 db.delete_unique('dvcs_change', ['tree_id', 'revision'])
43 # Deleting model 'Change'
44 db.delete_table('dvcs_change')
46 # Deleting model 'Document'
47 db.delete_table('dvcs_document')
52 'Meta': {'object_name': 'Group'},
53 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
54 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
55 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
58 'Meta': {'ordering': "('content_type__app_label', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
59 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
60 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
61 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
62 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
65 'Meta': {'object_name': 'User'},
66 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
67 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
68 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
69 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
70 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
71 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
72 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
73 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
74 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
75 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
76 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
77 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
78 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
80 'contenttypes.contenttype': {
81 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
82 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
83 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
84 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
85 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
88 'Meta': {'ordering': "('created_at',)", 'unique_together': "(['tree', 'revision'],)", 'object_name': 'Change'},
89 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
90 'author_desc': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
91 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}),
92 'description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
93 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
94 'merge_parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'merge_children'", 'null': 'True', 'blank': 'True', 'to': "orm['dvcs.Change']"}),
95 'parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'children'", 'null': 'True', 'blank': 'True', 'to': "orm['dvcs.Change']"}),
96 'patch': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
97 'revision': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
98 'tree': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['dvcs.Document']"})
101 'Meta': {'object_name': 'Document'},
102 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
103 'head': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['dvcs.Change']", 'null': 'True', 'blank': 'True'}),
104 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
108 complete_apps = ['dvcs']