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 'ManyToManyValue'
12 db.create_table('philo_manytomanyvalue', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='many_to_many_value_set', null=True, to=orm['contenttypes.ContentType'])),
15 ('object_ids', self.gf('django.db.models.fields.CommaSeparatedIntegerField')(max_length=300, null=True, blank=True)),
17 db.send_create_signal('philo', ['ManyToManyValue'])
19 # Adding model 'JSONValue'
20 db.create_table('philo_jsonvalue', (
21 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
22 ('value', self.gf('philo.models.fields.JSONField')()),
24 db.send_create_signal('philo', ['JSONValue'])
26 # Adding model 'ForeignKeyValue'
27 db.create_table('philo_foreignkeyvalue', (
28 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
29 ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='foreign_key_value_set', null=True, to=orm['contenttypes.ContentType'])),
30 ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
32 db.send_create_signal('philo', ['ForeignKeyValue'])
34 # Adding field 'Attribute.value_content_type'
35 db.add_column('philo_attribute', 'value_content_type', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='attribute_value_set', null=True, to=orm['contenttypes.ContentType']), keep_default=False)
37 # Adding field 'Attribute.value_object_id'
38 db.add_column('philo_attribute', 'value_object_id', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True), keep_default=False)
40 # Adding unique constraint on 'Attribute', fields ['value_object_id', 'value_content_type']
41 db.create_unique('philo_attribute', ['value_object_id', 'value_content_type_id'])
43 # Manual addition! This is necessary to immediately cause contenttype creation.
44 # (needed for the next migration)
45 db.send_pending_create_signals()
48 def backwards(self, orm):
50 # Deleting model 'ManyToManyValue'
51 db.delete_table('philo_manytomanyvalue')
53 # Deleting model 'JSONValue'
54 db.delete_table('philo_jsonvalue')
56 # Deleting model 'ForeignKeyValue'
57 db.delete_table('philo_foreignkeyvalue')
59 # Deleting field 'Attribute.value_content_type'
60 db.delete_column('philo_attribute', 'value_content_type_id')
62 # Deleting field 'Attribute.value_object_id'
63 db.delete_column('philo_attribute', 'value_object_id')
65 # Removing unique constraint on 'Attribute', fields ['value_object_id', 'value_content_type']
66 db.delete_unique('philo_attribute', ['value_object_id', 'value_content_type_id'])
70 'contenttypes.contenttype': {
71 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
72 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
73 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
74 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
75 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
78 'Meta': {'unique_together': "(('key', 'entity_content_type', 'entity_object_id'), ('value_content_type', 'value_object_id'))", 'object_name': 'Attribute'},
79 'entity_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_entity_set'", 'to': "orm['contenttypes.ContentType']"}),
80 'entity_object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
81 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
82 'key': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
83 'value_content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attribute_value_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
84 'value_object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
85 'value': ('philo.models.fields.JSONField', [], {})
88 'Meta': {'object_name': 'Collection'},
89 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
90 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
91 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
93 'philo.collectionmember': {
94 'Meta': {'object_name': 'CollectionMember'},
95 'collection': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'members'", 'to': "orm['philo.Collection']"}),
96 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
97 'index': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
98 'member_content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
99 'member_object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
101 'philo.contentlet': {
102 'Meta': {'object_name': 'Contentlet'},
103 'content': ('philo.models.fields.TemplateField', [], {}),
104 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
105 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
106 'page': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'contentlets'", 'to': "orm['philo.Page']"})
108 'philo.contentreference': {
109 'Meta': {'object_name': 'ContentReference'},
110 'content_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
111 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
112 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
113 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
114 'page': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'contentreferences'", 'to': "orm['philo.Page']"})
117 'Meta': {'object_name': 'File'},
118 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
119 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
120 'mimetype': ('django.db.models.fields.CharField', [], {'max_length': '255'})
122 'philo.foreignkeyvalue': {
123 'Meta': {'object_name': 'ForeignKeyValue'},
124 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'foreign_key_value_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
125 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
126 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
129 'Meta': {'object_name': 'JSONValue'},
130 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
131 'value': ('philo.models.fields.JSONField', [], {})
133 'philo.manytomanyvalue': {
134 'Meta': {'object_name': 'ManyToManyValue'},
135 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'many_to_many_value_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
136 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
137 'object_ids': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'})
140 'Meta': {'object_name': 'Node'},
141 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
142 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['philo.Node']"}),
143 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'}),
144 'view_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'node_view_set'", 'to': "orm['contenttypes.ContentType']"}),
145 'view_object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
148 'Meta': {'object_name': 'Page'},
149 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
150 'template': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pages'", 'to': "orm['philo.Template']"}),
151 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
154 'Meta': {'object_name': 'Redirect'},
155 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
156 'status_code': ('django.db.models.fields.IntegerField', [], {'default': '302'}),
157 'target': ('django.db.models.fields.CharField', [], {'max_length': '200'})
159 'philo.relationship': {
160 'Meta': {'unique_together': "(('key', 'entity_content_type', 'entity_object_id'),)", 'object_name': 'Relationship'},
161 'entity_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'relationship_entity_set'", 'to': "orm['contenttypes.ContentType']"}),
162 'entity_object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
163 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
164 'key': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
165 'value_content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'relationship_value_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
166 'value_object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
169 'Meta': {'object_name': 'Tag'},
170 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
171 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
172 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'})
175 'Meta': {'object_name': 'Template'},
176 'code': ('philo.models.fields.TemplateField', [], {}),
177 'documentation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
178 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
179 'mimetype': ('django.db.models.fields.CharField', [], {'default': "'text/html'", 'max_length': '255'}),
180 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
181 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['philo.Template']"}),
182 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'})
186 complete_apps = ['philo']