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('catalogue_tag', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('name', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)),
15 ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)),
16 ('sort_key', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)),
17 ('category', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)),
18 ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
19 ('main_page', self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True)),
20 ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
21 ('book_count', self.gf('django.db.models.fields.IntegerField')(null=True)),
22 ('death', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
23 ('gazeta_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)),
24 ('wiki_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)),
26 db.send_create_signal('catalogue', ['Tag'])
28 # Adding unique constraint on 'Tag', fields ['slug', 'category']
29 db.create_unique('catalogue_tag', ['slug', 'category'])
31 # Adding model 'TagRelation'
32 db.create_table('catalogue_tag_relation', (
33 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
34 ('tag', self.gf('django.db.models.fields.related.ForeignKey')(related_name='items', to=orm['catalogue.Tag'])),
35 ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
36 ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
38 db.send_create_signal('catalogue', ['TagRelation'])
40 # Adding unique constraint on 'TagRelation', fields ['tag', 'content_type', 'object_id']
41 db.create_unique('catalogue_tag_relation', ['tag_id', 'content_type_id', 'object_id'])
44 db.create_table('catalogue_book', (
45 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
46 ('title', self.gf('django.db.models.fields.CharField')(max_length=120)),
47 ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=120, db_index=True)),
48 ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
49 ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
50 ('_short_html', self.gf('django.db.models.fields.TextField')()),
51 ('_short_html_de', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
52 ('_short_html_en', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
53 ('_short_html_es', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
54 ('_short_html_fr', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
55 ('_short_html_lt', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
56 ('_short_html_pl', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
57 ('_short_html_ru', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
58 ('_short_html_uk', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
59 ('parent_number', self.gf('django.db.models.fields.IntegerField')(default=0)),
60 ('extra_info', self.gf('catalogue.fields.JSONField')()),
61 ('gazeta_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)),
62 ('wiki_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)),
63 ('xml_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
64 ('html_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
65 ('pdf_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
66 ('epub_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
67 ('odt_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
68 ('txt_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
69 ('mp3_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
70 ('ogg_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
71 ('parent', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='children', null=True, to=orm['catalogue.Book'])),
72 ('_tag_counter', self.gf('catalogue.fields.JSONField')(null=True)),
73 ('_theme_counter', self.gf('catalogue.fields.JSONField')(null=True)),
75 db.send_create_signal('catalogue', ['Book'])
77 # Adding model 'Fragment'
78 db.create_table('catalogue_fragment', (
79 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
80 ('text', self.gf('django.db.models.fields.TextField')()),
81 ('short_text', self.gf('django.db.models.fields.TextField')()),
82 ('_short_html', self.gf('django.db.models.fields.TextField')()),
83 ('_short_html_de', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
84 ('_short_html_en', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
85 ('_short_html_es', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
86 ('_short_html_fr', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
87 ('_short_html_lt', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
88 ('_short_html_pl', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
89 ('_short_html_ru', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
90 ('_short_html_uk', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
91 ('anchor', self.gf('django.db.models.fields.CharField')(max_length=120)),
92 ('book', self.gf('django.db.models.fields.related.ForeignKey')(related_name='fragments', to=orm['catalogue.Book'])),
94 db.send_create_signal('catalogue', ['Fragment'])
96 # Adding model 'BookStub'
97 db.create_table('catalogue_bookstub', (
98 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
99 ('title', self.gf('django.db.models.fields.CharField')(max_length=120)),
100 ('author', self.gf('django.db.models.fields.CharField')(max_length=120)),
101 ('pd', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
102 ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=120, db_index=True)),
103 ('translator', self.gf('django.db.models.fields.TextField')(blank=True)),
104 ('translator_death', self.gf('django.db.models.fields.TextField')(blank=True)),
106 db.send_create_signal('catalogue', ['BookStub'])
108 # Adding model 'FileRecord'
109 db.create_table('catalogue_filerecord', (
110 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
111 ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)),
112 ('type', self.gf('django.db.models.fields.CharField')(max_length=20, db_index=True)),
113 ('sha1', self.gf('django.db.models.fields.CharField')(max_length=40)),
114 ('time', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
116 db.send_create_signal('catalogue', ['FileRecord'])
119 def backwards(self, orm):
121 # Removing unique constraint on 'TagRelation', fields ['tag', 'content_type', 'object_id']
122 db.delete_unique('catalogue_tag_relation', ['tag_id', 'content_type_id', 'object_id'])
124 # Removing unique constraint on 'Tag', fields ['slug', 'category']
125 db.delete_unique('catalogue_tag', ['slug', 'category'])
127 # Deleting model 'Tag'
128 db.delete_table('catalogue_tag')
130 # Deleting model 'TagRelation'
131 db.delete_table('catalogue_tag_relation')
133 # Deleting model 'Book'
134 db.delete_table('catalogue_book')
136 # Deleting model 'Fragment'
137 db.delete_table('catalogue_fragment')
139 # Deleting model 'BookStub'
140 db.delete_table('catalogue_bookstub')
142 # Deleting model 'FileRecord'
143 db.delete_table('catalogue_filerecord')
148 'Meta': {'object_name': 'Group'},
149 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
150 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
151 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
154 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
155 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
156 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
157 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
158 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
161 'Meta': {'object_name': 'User'},
162 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
163 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
164 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
165 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
166 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
167 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
168 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
169 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
170 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
171 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
172 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
173 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
174 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
177 'Meta': {'ordering': "('title',)", 'object_name': 'Book'},
178 '_short_html': ('django.db.models.fields.TextField', [], {}),
179 '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
180 '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
181 '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
182 '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
183 '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
184 '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
185 '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
186 '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
187 '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}),
188 '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}),
189 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
190 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
191 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
192 'extra_info': ('catalogue.fields.JSONField', [], {}),
193 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
194 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
195 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
196 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
197 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
198 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
199 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
200 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
201 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
202 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}),
203 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
204 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
205 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
206 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
208 'catalogue.bookstub': {
209 'Meta': {'ordering': "('title',)", 'object_name': 'BookStub'},
210 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
211 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
212 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
213 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}),
214 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
215 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
216 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'})
218 'catalogue.filerecord': {
219 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'},
220 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
221 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
222 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
223 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
224 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'})
226 'catalogue.fragment': {
227 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
228 '_short_html': ('django.db.models.fields.TextField', [], {}),
229 '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
230 '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
231 '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
232 '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
233 '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
234 '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
235 '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
236 '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
237 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
238 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
239 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
240 'short_text': ('django.db.models.fields.TextField', [], {}),
241 'text': ('django.db.models.fields.TextField', [], {})
244 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
245 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
246 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
247 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
248 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
249 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
250 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
251 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
252 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
253 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
254 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
255 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
256 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
258 'catalogue.tagrelation': {
259 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
260 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
261 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
262 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
263 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
265 'contenttypes.contenttype': {
266 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
267 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
268 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
269 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
270 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
274 complete_apps = ['catalogue']