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 field 'Book.changed_at'
12 db.add_column('catalogue_book', 'changed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2011, 2, 25, 15, 19, 36, 525463), db_index=True, blank=True), keep_default=False)
14 # Adding index on 'Book', fields ['created_at']
15 db.create_index('catalogue_book', ['created_at'])
17 # Adding field 'Tag.created_at'
18 db.add_column('catalogue_tag', 'created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2011, 2, 25, 15, 19, 42, 921525), db_index=True, blank=True), keep_default=False)
20 # Adding field 'Tag.changed_at'
21 db.add_column('catalogue_tag', 'changed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2011, 2, 25, 15, 19, 45, 697471), db_index=True, blank=True), keep_default=False)
24 def backwards(self, orm):
26 # Removing index on 'Book', fields ['created_at']
27 db.delete_index('catalogue_book', ['created_at'])
29 # Deleting field 'Book.changed_at'
30 db.delete_column('catalogue_book', 'changed_at')
32 # Deleting field 'Tag.created_at'
33 db.delete_column('catalogue_tag', 'created_at')
35 # Deleting field 'Tag.changed_at'
36 db.delete_column('catalogue_tag', 'changed_at')
41 'Meta': {'object_name': 'Group'},
42 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
43 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}),
44 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
47 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
48 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
49 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
50 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
51 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
54 'Meta': {'object_name': 'User'},
55 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
56 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
57 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
58 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
59 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
60 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
61 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
62 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
63 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
64 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
65 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
66 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
67 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'})
70 'Meta': {'ordering': "('title',)", 'object_name': 'Book'},
71 '_short_html': ('django.db.models.fields.TextField', [], {}),
72 '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
73 '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
74 '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
75 '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
76 '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
77 '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
78 '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
79 '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
80 '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}),
81 '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}),
82 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
83 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
84 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
85 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
86 'extra_info': ('catalogue.fields.JSONField', [], {}),
87 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
88 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
89 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
90 'medias': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.BookMedia']", 'symmetrical': 'False', 'blank': 'True'}),
91 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}),
92 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
93 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
94 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}),
95 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
96 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
97 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
98 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
100 'catalogue.bookmedia': {
101 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
102 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
103 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
104 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
105 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
106 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
107 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
109 'catalogue.filerecord': {
110 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'},
111 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
112 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
113 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
114 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
115 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'})
117 'catalogue.fragment': {
118 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
119 '_short_html': ('django.db.models.fields.TextField', [], {}),
120 '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
121 '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
122 '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
123 '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
124 '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
125 '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
126 '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
127 '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
128 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
129 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
130 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
131 'short_text': ('django.db.models.fields.TextField', [], {}),
132 'text': ('django.db.models.fields.TextField', [], {})
135 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
136 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
137 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
138 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
139 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
140 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
141 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
142 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
143 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
144 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
145 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
146 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
147 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
148 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
150 'catalogue.tagrelation': {
151 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
152 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
153 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
154 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
155 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
157 'contenttypes.contenttype': {
158 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
159 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
160 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
161 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
162 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
166 complete_apps = ['catalogue']