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 unique constraint on 'Book', fields ['slug', 'language']
12 db.delete_unique('catalogue_book', ['slug', 'language'])
14 # Adding field 'Book.common_slug'
15 db.add_column('catalogue_book', 'common_slug', self.gf('django.db.models.fields.SlugField')(default='-', max_length=120, db_index=True), keep_default=False)
17 # Adding unique constraint on 'Book', fields ['slug']
18 db.create_unique('catalogue_book', ['slug'])
21 def backwards(self, orm):
23 # Removing unique constraint on 'Book', fields ['slug']
24 db.delete_unique('catalogue_book', ['slug'])
26 # Deleting field 'Book.common_slug'
27 db.delete_column('catalogue_book', 'common_slug')
29 # Adding unique constraint on 'Book', fields ['slug', 'language']
30 db.create_unique('catalogue_book', ['slug', 'language'])
35 'Meta': {'object_name': 'Group'},
36 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
37 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
38 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
41 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
42 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
43 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
44 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
45 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
48 'Meta': {'object_name': 'User'},
49 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
50 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
51 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
52 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
53 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
54 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
55 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
56 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
57 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
58 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
59 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
60 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
61 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
64 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'},
65 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
66 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
67 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
68 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
69 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
70 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
71 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
72 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
73 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
74 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
75 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}),
76 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
77 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
78 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
79 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
80 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}),
81 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
82 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
83 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
84 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
85 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
87 'catalogue.bookmedia': {
88 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
89 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
90 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
91 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}),
92 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
93 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
94 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
95 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
96 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
98 'catalogue.fragment': {
99 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
100 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
101 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
102 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
103 'short_text': ('django.db.models.fields.TextField', [], {}),
104 'text': ('django.db.models.fields.TextField', [], {})
107 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
108 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
109 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
110 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
111 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
112 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
113 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
114 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
115 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
116 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
117 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
118 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
119 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
121 'catalogue.tagrelation': {
122 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
123 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
124 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
125 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
126 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
128 'contenttypes.contenttype': {
129 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
130 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
131 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
132 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
133 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
137 complete_apps = ['catalogue']