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):
12 db.create_table('catalogue_tag', (
13 ('category', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)),
14 ('gazeta_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)),
15 ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
16 ('main_page', self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True, blank=True)),
17 ('sort_key', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)),
18 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
19 ('wiki_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)),
20 ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)),
21 ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=120, db_index=True)),
22 ('book_count', self.gf('django.db.models.fields.IntegerField')(default=0)),
23 ('name', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)),
25 db.send_create_signal('catalogue', ['Tag'])
27 # Adding model 'TagRelation'
28 db.create_table('catalogue_tag_relation', (
29 ('tag', self.gf('django.db.models.fields.related.ForeignKey')(related_name='items', to=orm['catalogue.Tag'])),
30 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
31 ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])),
32 ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')(db_index=True)),
34 db.send_create_signal('catalogue', ['TagRelation'])
36 # Adding unique constraint on 'TagRelation', fields ['tag', 'content_type', 'object_id']
37 db.create_unique('catalogue_tag_relation', ['tag_id', 'content_type_id', 'object_id'])
40 db.create_table('catalogue_book', (
41 ('parent', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='children', null=True, to=orm['catalogue.Book'])),
42 ('mp3_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
43 ('xml_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
44 ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
45 ('wiki_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)),
46 ('title', self.gf('django.db.models.fields.CharField')(max_length=120)),
47 ('txt_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
48 ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
49 ('pdf_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
50 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
51 ('html_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
52 ('_short_html', self.gf('django.db.models.fields.TextField')()),
53 ('parent_number', self.gf('django.db.models.fields.IntegerField')(default=0)),
54 ('ogg_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
55 ('odt_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)),
56 ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=120, db_index=True)),
57 ('gazeta_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)),
58 ('extra_info', self.gf('catalogue.fields.JSONField')()),
60 db.send_create_signal('catalogue', ['Book'])
62 # Adding model 'Fragment'
63 db.create_table('catalogue_fragment', (
64 ('text', self.gf('django.db.models.fields.TextField')()),
65 ('anchor', self.gf('django.db.models.fields.CharField')(max_length=120)),
66 ('_short_html', self.gf('django.db.models.fields.TextField')()),
67 ('book', self.gf('django.db.models.fields.related.ForeignKey')(related_name='fragments', to=orm['catalogue.Book'])),
68 ('short_text', self.gf('django.db.models.fields.TextField')()),
69 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
71 db.send_create_signal('catalogue', ['Fragment'])
74 def backwards(self, orm):
76 # Deleting model 'Tag'
77 db.delete_table('catalogue_tag')
79 # Deleting model 'TagRelation'
80 db.delete_table('catalogue_tag_relation')
82 # Removing unique constraint on 'TagRelation', fields ['tag', 'content_type', 'object_id']
83 db.delete_unique('catalogue_tag_relation', ['tag_id', 'content_type_id', 'object_id'])
85 # Deleting model 'Book'
86 db.delete_table('catalogue_book')
88 # Deleting model 'Fragment'
89 db.delete_table('catalogue_fragment')
94 'Meta': {'object_name': 'Group'},
95 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
96 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
97 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
100 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
101 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
102 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
103 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
104 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
107 'Meta': {'object_name': 'User'},
108 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
109 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
110 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
111 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
112 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
113 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
114 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
115 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
116 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
117 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
118 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
119 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
120 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
123 'Meta': {'object_name': 'Book'},
124 '_short_html': ('django.db.models.fields.TextField', [], {}),
125 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
126 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
127 'extra_info': ('catalogue.fields.JSONField', [], {}),
128 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
129 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
130 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
131 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
132 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
133 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
134 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
135 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
136 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
137 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}),
138 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
139 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
140 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
141 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
143 'catalogue.fragment': {
144 'Meta': {'object_name': 'Fragment'},
145 '_short_html': ('django.db.models.fields.TextField', [], {}),
146 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
147 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
148 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
149 'short_text': ('django.db.models.fields.TextField', [], {}),
150 'text': ('django.db.models.fields.TextField', [], {})
153 'Meta': {'object_name': 'Tag'},
154 'book_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
155 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
156 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
157 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
158 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
159 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}),
160 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
161 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}),
162 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
163 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
164 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
166 'catalogue.tagrelation': {
167 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
168 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
169 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
170 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
171 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
173 'contenttypes.contenttype': {
174 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
175 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
176 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
177 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
178 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
182 complete_apps = ['catalogue']