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 # Removing M2M table for field medias on 'Book'
12 db.delete_table('catalogue_book_medias')
15 def backwards(self, orm):
17 # Adding M2M table for field medias on 'Book'
18 db.create_table('catalogue_book_medias', (
19 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
20 ('book', models.ForeignKey(orm['catalogue.book'], null=False)),
21 ('bookmedia', models.ForeignKey(orm['catalogue.bookmedia'], null=False))
23 db.create_unique('catalogue_book_medias', ['book_id', 'bookmedia_id'])
28 'Meta': {'object_name': 'Group'},
29 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
30 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}),
31 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
34 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
35 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
36 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
37 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
38 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
41 'Meta': {'object_name': 'User'},
42 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
43 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
44 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
45 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
46 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
47 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
48 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
49 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
50 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
51 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
52 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
53 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
54 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'})
57 'Meta': {'ordering': "('title',)", 'object_name': 'Book'},
58 '_short_html': ('django.db.models.fields.TextField', [], {}),
59 '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
60 '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
61 '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
62 '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
63 '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
64 '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
65 '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
66 '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
67 '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}),
68 '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}),
69 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
70 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
71 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
72 'extra_info': ('catalogue.fields.JSONField', [], {}),
73 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
74 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
75 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
76 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}),
77 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
78 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
79 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}),
80 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
81 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
82 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
83 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
85 'catalogue.bookmedia': {
86 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
87 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
88 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
89 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
90 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
91 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
92 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
93 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
95 'catalogue.filerecord': {
96 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'},
97 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
98 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
99 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
100 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
101 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'})
103 'catalogue.fragment': {
104 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
105 '_short_html': ('django.db.models.fields.TextField', [], {}),
106 '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
107 '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
108 '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
109 '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
110 '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
111 '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
112 '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
113 '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
114 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
115 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
116 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
117 'short_text': ('django.db.models.fields.TextField', [], {}),
118 'text': ('django.db.models.fields.TextField', [], {})
121 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
122 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
123 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
124 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
125 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
126 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
127 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
128 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
129 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
130 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
131 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
132 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
134 'catalogue.tagrelation': {
135 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
136 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
137 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
138 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
139 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
141 'contenttypes.contenttype': {
142 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
143 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
144 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
145 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
146 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
150 complete_apps = ['catalogue']