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