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 'BookPublishRecord'
12 db.create_table('catalogue_bookpublishrecord', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('book', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['catalogue.Book'])),
15 ('timestamp', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
16 ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
18 db.send_create_signal('catalogue', ['BookPublishRecord'])
20 # Adding model 'ChunkPublishRecord'
21 db.create_table('catalogue_chunkpublishrecord', (
22 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
23 ('book_record', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['catalogue.BookPublishRecord'])),
24 ('change', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['catalogue.ChunkChange'])),
26 db.send_create_signal('catalogue', ['ChunkPublishRecord'])
28 # Deleting field 'Book.last_published'
29 db.delete_column('catalogue_book', 'last_published')
32 def backwards(self, orm):
34 # Deleting model 'BookPublishRecord'
35 db.delete_table('catalogue_bookpublishrecord')
37 # Deleting model 'ChunkPublishRecord'
38 db.delete_table('catalogue_chunkpublishrecord')
40 # Adding field 'Book.last_published'
41 db.add_column('catalogue_book', 'last_published', self.gf('django.db.models.fields.DateTimeField')(null=True, db_index=True), keep_default=False)
46 'Meta': {'object_name': 'Group'},
47 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
48 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
49 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
52 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
53 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
54 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
55 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
56 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
59 'Meta': {'object_name': 'User'},
60 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
61 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
62 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
63 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
64 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
65 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
66 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
67 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
68 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
69 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
70 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
71 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
72 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
75 'Meta': {'ordering': "['parent_number', 'title']", 'object_name': 'Book'},
76 'gallery': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
77 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
78 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
79 'parent_number': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
80 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
81 'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'})
83 'catalogue.bookpublishrecord': {
84 'Meta': {'ordering': "['-timestamp']", 'object_name': 'BookPublishRecord'},
85 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']"}),
86 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
87 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
88 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
91 'Meta': {'ordering': "['number']", 'unique_together': "[['book', 'number'], ['book', 'slug']]", 'object_name': 'Chunk'},
92 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']"}),
93 'comment': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
94 'creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'created_documents'", 'null': 'True', 'to': "orm['auth.User']"}),
95 'head': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['catalogue.ChunkChange']", 'null': 'True', 'blank': 'True'}),
96 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
97 'number': ('django.db.models.fields.IntegerField', [], {}),
98 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}),
99 'stage': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ChunkTag']", 'null': 'True', 'blank': 'True'}),
100 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
102 'catalogue.chunkchange': {
103 'Meta': {'ordering': "('created_at',)", 'unique_together': "(['tree', 'revision'],)", 'object_name': 'ChunkChange'},
104 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
105 'author_email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
106 'author_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
107 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}),
108 'description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
109 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
110 'merge_parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'merge_children'", 'null': 'True', 'blank': 'True', 'to': "orm['catalogue.ChunkChange']"}),
111 'parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'children'", 'null': 'True', 'blank': 'True', 'to': "orm['catalogue.ChunkChange']"}),
112 'patch': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
113 'publishable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
114 'revision': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
115 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'change_set'", 'symmetrical': 'False', 'to': "orm['catalogue.ChunkTag']"}),
116 'tree': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'change_set'", 'to': "orm['catalogue.Chunk']"})
118 'catalogue.chunkpublishrecord': {
119 'Meta': {'object_name': 'ChunkPublishRecord'},
120 'book_record': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.BookPublishRecord']"}),
121 'change': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ChunkChange']"}),
122 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
124 'catalogue.chunktag': {
125 'Meta': {'ordering': "['ordering']", 'object_name': 'ChunkTag'},
126 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
127 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
128 'ordering': ('django.db.models.fields.IntegerField', [], {}),
129 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'})
131 'contenttypes.contenttype': {
132 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
133 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
134 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
135 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
136 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
140 complete_apps = ['catalogue']