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 ('patch', self.gf('django.db.models.fields.TextField')(blank=True)),
16 ('tree', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['dvcs.Document'])),
17 ('revision', self.gf('django.db.models.fields.IntegerField')(db_index=True)),
18 ('parent', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='children', null=True, blank=True, to=orm['dvcs.Change'])),
19 ('merge_parent', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='merge_children', null=True, blank=True, to=orm['dvcs.Change'])),
20 ('description', self.gf('django.db.models.fields.TextField')(default='', blank=True)),
21 ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)),
23 db.send_create_signal('dvcs', ['Change'])
25 # Adding unique constraint on 'Change', fields ['tree', 'revision']
26 db.create_unique('dvcs_change', ['tree_id', 'revision'])
28 # Adding model 'Document'
29 db.create_table('dvcs_document', (
30 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
31 ('creator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
32 ('head', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['dvcs.Change'], null=True, blank=True)),
34 db.send_create_signal('dvcs', ['Document'])
37 def backwards(self, orm):
39 # Removing unique constraint on 'Change', fields ['tree', 'revision']
40 db.delete_unique('dvcs_change', ['tree_id', 'revision'])
42 # Deleting model 'Change'
43 db.delete_table('dvcs_change')
45 # Deleting model 'Document'
46 db.delete_table('dvcs_document')
51 'Meta': {'object_name': 'Group'},
52 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
53 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
54 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
57 'Meta': {'ordering': "('content_type__app_label', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
58 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
59 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
60 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
61 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
64 'Meta': {'object_name': 'User'},
65 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
66 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
67 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
68 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
69 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
70 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
71 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
72 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
73 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
74 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
75 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
76 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
77 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
79 'contenttypes.contenttype': {
80 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
81 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
82 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
83 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
84 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
87 'Meta': {'ordering': "('created_at',)", 'unique_together': "(['tree', 'revision'],)", 'object_name': 'Change'},
88 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
89 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
90 'description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
91 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
92 'merge_parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'merge_children'", 'null': 'True', 'blank': 'True', 'to': "orm['dvcs.Change']"}),
93 'parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'children'", 'null': 'True', 'blank': 'True', 'to': "orm['dvcs.Change']"}),
94 'patch': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
95 'revision': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
96 'tree': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['dvcs.Document']"})
99 'Meta': {'object_name': 'Document'},
100 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
101 'head': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['dvcs.Change']", 'null': 'True', 'blank': 'True'}),
102 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
106 complete_apps = ['dvcs']