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']
12 db.delete_unique('catalogue_book', ['slug'])
14 # Adding field 'Book.language'
15 db.add_column('catalogue_book', 'language', self.gf('django.db.models.fields.CharField')(default='pol', max_length=3, db_index=True), keep_default=False)
17 # Adding unique constraint on 'Book', fields ['slug', 'language']
18 db.create_unique('catalogue_book', ['slug', 'language'])
21 def backwards(self, orm):
23 # Removing unique constraint on 'Book', fields ['slug', 'language']
24 db.delete_unique('catalogue_book', ['slug', 'language'])
26 # Deleting field 'Book.language'
27 db.delete_column('catalogue_book', 'language')
29 # Adding unique constraint on 'Book', fields ['slug']
30 db.create_unique('catalogue_book', ['slug'])
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',)", 'unique_together': "[['slug', 'language']]", 'object_name': 'Book'},
65 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
66 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
67 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
68 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
69 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
70 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
71 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
72 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
73 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}),
74 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
75 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
76 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
77 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
78 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
79 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', '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': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}),
90 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
91 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
92 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
93 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
94 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
96 'catalogue.filerecord': {
97 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'},
98 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
99 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
100 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
101 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
102 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'})
104 'catalogue.fragment': {
105 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
106 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
107 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
108 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
109 'short_text': ('django.db.models.fields.TextField', [], {}),
110 'text': ('django.db.models.fields.TextField', [], {})
113 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
114 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
115 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
116 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
117 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
118 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
119 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
120 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
121 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
122 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
123 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
124 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
125 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
126 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
128 'catalogue.tagrelation': {
129 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
130 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
131 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
132 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
133 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
135 'contenttypes.contenttype': {
136 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
137 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
138 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
139 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
140 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
144 complete_apps = ['catalogue']