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 'BookMedia'
12 db.create_table('catalogue_bookmedia', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('type', self.gf('django.db.models.fields.CharField')(max_length='100')),
15 ('name', self.gf('django.db.models.fields.CharField')(max_length='100')),
16 ('file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
17 ('uploaded_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
19 db.send_create_signal('catalogue', ['BookMedia'])
21 # Deleting field 'Book.txt_file'
22 db.delete_column('catalogue_book', 'txt_file')
24 # Deleting field 'Book.odt_file'
25 db.delete_column('catalogue_book', 'odt_file')
27 # Deleting field 'Book.daisy_file'
28 db.delete_column('catalogue_book', 'daisy_file')
30 # Deleting field 'Book.ogg_file'
31 db.delete_column('catalogue_book', 'ogg_file')
33 # Deleting field 'Book.mp3_file'
34 db.delete_column('catalogue_book', 'mp3_file')
36 # Adding M2M table for field medias on 'Book'
37 db.create_table('catalogue_book_medias', (
38 ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
39 ('book', models.ForeignKey(orm['catalogue.book'], null=False)),
40 ('bookmedia', models.ForeignKey(orm['catalogue.bookmedia'], null=False))
42 db.create_unique('catalogue_book_medias', ['book_id', 'bookmedia_id'])
44 # Changing field 'Tag.main_page'
45 db.alter_column('catalogue_tag', 'main_page', self.gf('django.db.models.fields.BooleanField')(blank=True))
48 def backwards(self, orm):
50 # Deleting model 'BookMedia'
51 db.delete_table('catalogue_bookmedia')
53 # Adding field 'Book.txt_file'
54 db.add_column('catalogue_book', 'txt_file', self.gf('django.db.models.fields.files.FileField')(default=None, max_length=100, blank=True), keep_default=False)
56 # Adding field 'Book.odt_file'
57 db.add_column('catalogue_book', 'odt_file', self.gf('django.db.models.fields.files.FileField')(default=None, max_length=100, blank=True), keep_default=False)
59 # Adding field 'Book.daisy_file'
60 db.add_column('catalogue_book', 'daisy_file', self.gf('django.db.models.fields.files.FileField')(default=None, max_length=100, blank=True), keep_default=False)
62 # Adding field 'Book.ogg_file'
63 db.add_column('catalogue_book', 'ogg_file', self.gf('django.db.models.fields.files.FileField')(default=None, max_length=100, blank=True), keep_default=False)
65 # Adding field 'Book.mp3_file'
66 db.add_column('catalogue_book', 'mp3_file', self.gf('django.db.models.fields.files.FileField')(default=None, max_length=100, blank=True), keep_default=False)
68 # Removing M2M table for field medias on 'Book'
69 db.delete_table('catalogue_book_medias')
71 # Changing field 'Tag.main_page'
72 db.alter_column('catalogue_tag', 'main_page', self.gf('django.db.models.fields.BooleanField')())
77 'Meta': {'object_name': 'Group'},
78 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
79 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}),
80 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
83 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
84 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
85 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
86 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
87 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
90 'Meta': {'object_name': 'User'},
91 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
92 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
93 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
94 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
95 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
96 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
97 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
98 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
99 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
100 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
101 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
102 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
103 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'})
106 'Meta': {'object_name': 'Book'},
107 '_short_html': ('django.db.models.fields.TextField', [], {}),
108 '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
109 '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
110 '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
111 '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
112 '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
113 '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
114 '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
115 '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
116 '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}),
117 '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}),
118 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
119 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
120 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
121 'extra_info': ('catalogue.fields.JSONField', [], {}),
122 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
123 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
124 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
125 'medias': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.BookMedia']", 'symmetrical': 'False'}),
126 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}),
127 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
128 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
129 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}),
130 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
131 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
132 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
134 'catalogue.bookmedia': {
135 'Meta': {'object_name': 'BookMedia'},
136 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
137 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
138 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
139 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
140 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
142 'catalogue.bookstub': {
143 'Meta': {'object_name': 'BookStub'},
144 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
145 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
146 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
147 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}),
148 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
149 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
150 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'})
152 'catalogue.filerecord': {
153 'Meta': {'object_name': 'FileRecord'},
154 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
155 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
156 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
157 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
158 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'})
160 'catalogue.fragment': {
161 'Meta': {'object_name': 'Fragment'},
162 '_short_html': ('django.db.models.fields.TextField', [], {}),
163 '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
164 '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
165 '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
166 '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
167 '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
168 '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
169 '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
170 '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
171 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
172 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
173 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
174 'short_text': ('django.db.models.fields.TextField', [], {}),
175 'text': ('django.db.models.fields.TextField', [], {})
178 'Meta': {'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
179 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
180 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
181 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
182 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
183 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
184 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
185 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
186 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
187 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
188 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
189 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
190 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
192 'catalogue.tagrelation': {
193 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
194 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
195 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
196 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
197 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
199 'contenttypes.contenttype': {
200 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
201 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
202 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
203 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
204 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
208 complete_apps = ['catalogue']