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):
12 db.create_table('dvcs_tag', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('name', self.gf('django.db.models.fields.CharField')(max_length=64)),
15 ('slug', self.gf('django.db.models.fields.SlugField')(db_index=True, max_length=64, unique=True, null=True, blank=True)),
16 ('ordering', self.gf('django.db.models.fields.IntegerField')()),
18 db.send_create_signal('dvcs', ['Tag'])
20 # Adding model 'Change'
21 db.create_table('dvcs_change', (
22 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
23 ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
24 ('author_desc', self.gf('django.db.models.fields.CharField')(max_length=128, null=True, blank=True)),
25 ('patch', self.gf('django.db.models.fields.TextField')(blank=True)),
26 ('tree', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['dvcs.Document'])),
27 ('revision', self.gf('django.db.models.fields.IntegerField')(db_index=True)),
28 ('parent', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='children', null=True, blank=True, to=orm['dvcs.Change'])),
29 ('merge_parent', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='merge_children', null=True, blank=True, to=orm['dvcs.Change'])),
30 ('description', self.gf('django.db.models.fields.TextField')(default='', blank=True)),
31 ('created_at', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, db_index=True)),
32 ('publishable', self.gf('django.db.models.fields.BooleanField')(default=False)),
34 db.send_create_signal('dvcs', ['Change'])
36 # Adding unique constraint on 'Change', fields ['tree', 'revision']
37 db.create_unique('dvcs_change', ['tree_id', 'revision'])
39 # Adding M2M table for field tags on 'Change'
40 db.create_table('dvcs_change_tags', (
41 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
42 ('change', models.ForeignKey(orm['dvcs.change'], null=False)),
43 ('tag', models.ForeignKey(orm['dvcs.tag'], null=False))
45 db.create_unique('dvcs_change_tags', ['change_id', 'tag_id'])
47 # Adding model 'Document'
48 db.create_table('dvcs_document', (
49 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
50 ('creator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
51 ('head', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['dvcs.Change'], null=True, blank=True)),
53 db.send_create_signal('dvcs', ['Document'])
56 def backwards(self, orm):
58 # Removing unique constraint on 'Change', fields ['tree', 'revision']
59 db.delete_unique('dvcs_change', ['tree_id', 'revision'])
61 # Deleting model 'Tag'
62 db.delete_table('dvcs_tag')
64 # Deleting model 'Change'
65 db.delete_table('dvcs_change')
67 # Removing M2M table for field tags on 'Change'
68 db.delete_table('dvcs_change_tags')
70 # Deleting model 'Document'
71 db.delete_table('dvcs_document')
76 'Meta': {'object_name': 'Group'},
77 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
78 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
79 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
82 'Meta': {'ordering': "('content_type__app_label', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
83 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
84 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
85 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
86 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
89 'Meta': {'object_name': 'User'},
90 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
91 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
92 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
93 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
94 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
95 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
96 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
97 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
98 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
99 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
100 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
101 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
102 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
104 'contenttypes.contenttype': {
105 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
106 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
107 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
108 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
109 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
112 'Meta': {'ordering': "('created_at',)", 'unique_together': "(['tree', 'revision'],)", 'object_name': 'Change'},
113 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
114 'author_desc': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
115 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}),
116 'description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
117 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
118 'merge_parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'merge_children'", 'null': 'True', 'blank': 'True', 'to': "orm['dvcs.Change']"}),
119 'parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'children'", 'null': 'True', 'blank': 'True', 'to': "orm['dvcs.Change']"}),
120 'patch': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
121 'publishable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
122 'revision': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
123 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['dvcs.Tag']", 'symmetrical': 'False'}),
124 'tree': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['dvcs.Document']"})
127 'Meta': {'object_name': 'Document'},
128 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
129 'head': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['dvcs.Change']", 'null': 'True', 'blank': 'True'}),
130 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
133 'Meta': {'ordering': "['ordering']", 'object_name': 'Tag'},
134 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
135 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
136 'ordering': ('django.db.models.fields.IntegerField', [], {}),
137 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'})
141 complete_apps = ['dvcs']