db0451d242d51275e2309123576b4b0751b3f2b8
[philo.git] / migrations / 0008_auto__del_field_manytomanyvalue_object_ids.py
1 # encoding: utf-8
2 import datetime
3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
6
7 class Migration(SchemaMigration):
8
9     def forwards(self, orm):
10         
11         # Deleting field 'ManyToManyValue.object_ids'
12         db.delete_column('philo_manytomanyvalue', 'object_ids')
13
14         # Adding M2M table for field values on 'ManyToManyValue'
15         db.create_table('philo_manytomanyvalue_values', (
16             ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
17             ('manytomanyvalue', models.ForeignKey(orm['philo.manytomanyvalue'], null=False)),
18             ('foreignkeyvalue', models.ForeignKey(orm['philo.foreignkeyvalue'], null=False))
19         ))
20         db.create_unique('philo_manytomanyvalue_values', ['manytomanyvalue_id', 'foreignkeyvalue_id'])
21
22
23     def backwards(self, orm):
24         
25         # Adding field 'ManyToManyValue.object_ids'
26         db.add_column('philo_manytomanyvalue', 'object_ids', self.gf('django.db.models.fields.CommaSeparatedIntegerField')(max_length=300, null=True, blank=True), keep_default=False)
27
28         # Removing M2M table for field values on 'ManyToManyValue'
29         db.delete_table('philo_manytomanyvalue_values')
30
31
32     models = {
33         'contenttypes.contenttype': {
34             'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
35             'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
36             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
37             'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
38             'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
39         },
40         'philo.attribute': {
41             'Meta': {'unique_together': "(('key', 'entity_content_type', 'entity_object_id'), ('value_content_type', 'value_object_id'))", 'object_name': 'Attribute'},
42             'entity_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_entity_set'", 'to': "orm['contenttypes.ContentType']"}),
43             'entity_object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
44             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
45             'key': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
46             'value_content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attribute_value_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
47             'value_object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
48         },
49         'philo.collection': {
50             'Meta': {'object_name': 'Collection'},
51             'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
52             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
53             'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
54         },
55         'philo.collectionmember': {
56             'Meta': {'object_name': 'CollectionMember'},
57             'collection': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'members'", 'to': "orm['philo.Collection']"}),
58             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
59             'index': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
60             'member_content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
61             'member_object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
62         },
63         'philo.contentlet': {
64             'Meta': {'object_name': 'Contentlet'},
65             'content': ('philo.models.fields.TemplateField', [], {}),
66             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
67             'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
68             'page': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'contentlets'", 'to': "orm['philo.Page']"})
69         },
70         'philo.contentreference': {
71             'Meta': {'object_name': 'ContentReference'},
72             'content_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
73             'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
74             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
75             'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
76             'page': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'contentreferences'", 'to': "orm['philo.Page']"})
77         },
78         'philo.file': {
79             'Meta': {'object_name': 'File'},
80             'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
81             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
82             'mimetype': ('django.db.models.fields.CharField', [], {'max_length': '255'})
83         },
84         'philo.foreignkeyvalue': {
85             'Meta': {'object_name': 'ForeignKeyValue'},
86             'content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'foreign_key_value_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
87             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
88             'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
89         },
90         'philo.jsonvalue': {
91             'Meta': {'object_name': 'JSONValue'},
92             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
93             'value': ('philo.models.fields.JSONField', [], {})
94         },
95         'philo.manytomanyvalue': {
96             'Meta': {'object_name': 'ManyToManyValue'},
97             'content_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'many_to_many_value_set'", 'null': 'True', 'to': "orm['contenttypes.ContentType']"}),
98             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
99             'values': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['philo.ForeignKeyValue']", 'null': 'True', 'blank': 'True'})
100         },
101         'philo.node': {
102             'Meta': {'object_name': 'Node'},
103             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
104             'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['philo.Node']"}),
105             'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'}),
106             'view_content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'node_view_set'", 'to': "orm['contenttypes.ContentType']"}),
107             'view_object_id': ('django.db.models.fields.PositiveIntegerField', [], {})
108         },
109         'philo.page': {
110             'Meta': {'object_name': 'Page'},
111             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
112             'template': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pages'", 'to': "orm['philo.Template']"}),
113             'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
114         },
115         'philo.redirect': {
116             'Meta': {'object_name': 'Redirect'},
117             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
118             'status_code': ('django.db.models.fields.IntegerField', [], {'default': '302'}),
119             'target': ('django.db.models.fields.CharField', [], {'max_length': '200'})
120         },
121         'philo.tag': {
122             'Meta': {'object_name': 'Tag'},
123             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
124             'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
125             'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'})
126         },
127         'philo.template': {
128             'Meta': {'object_name': 'Template'},
129             'code': ('philo.models.fields.TemplateField', [], {}),
130             'documentation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
131             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
132             'mimetype': ('django.db.models.fields.CharField', [], {'default': "'text/html'", 'max_length': '255'}),
133             'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
134             'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['philo.Template']"}),
135             'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'})
136         }
137     }
138
139     complete_apps = ['philo']