camp/content/migrations/0005_auto_20171219_1032.py

86 lines
3.5 KiB
Python
Raw Normal View History

2017-12-19 10:40:02 +00:00
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-19 10:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import markdownx.models
class Migration(migrations.Migration):
dependencies = [
('content', '0004_auto_20171218_1149'),
]
operations = [
migrations.RunSQL(
[
('delete from content_resource where "resourceID" not in (select id from resources);', None),
('delete from content_resource where "contentID" not in (select id from content);', None),
('delete from person_content where "personID" not in (select id from people);', None),
('delete from person_content where "contentID" not in (select id from content);', None),
]
),
migrations.AddField(
model_name='content',
name='resources',
field=models.ManyToManyField(related_name='content', through='content.ContentResource', to='content.Resources'),
),
migrations.AddField(
model_name='people',
name='content',
field=models.ManyToManyField(related_name='people', through='content.PersonContent', to='content.Content'),
),
migrations.AddField(
model_name='people',
name='resources',
field=models.ManyToManyField(related_name='people', through='content.PersonResource', to='content.Resources'),
),
migrations.AlterField(
model_name='content',
name='body',
field=markdownx.models.MarkdownxField(blank=True, default='', null=True),
),
migrations.AlterField(
model_name='content',
name='parentid',
field=models.IntegerField(blank=True, db_column='parentID', editable=False, null=True),
),
migrations.AlterField(
model_name='contentresource',
name='contentid',
field=models.ForeignKey(db_column='contentID', on_delete=django.db.models.deletion.CASCADE, to='content.Content'),
),
migrations.AlterField(
model_name='contentresource',
name='resourceid',
field=models.ForeignKey(db_column='resourceID', on_delete=django.db.models.deletion.CASCADE, to='content.Resources'),
),
migrations.AlterField(
model_name='personcontent',
name='contentid',
field=models.ForeignKey(db_column='contentID', on_delete=django.db.models.deletion.CASCADE, to='content.Content'),
),
migrations.AlterField(
model_name='personcontent',
name='personid',
field=models.ForeignKey(db_column='personID', on_delete=django.db.models.deletion.CASCADE, to='content.People'),
),
migrations.AlterField(
model_name='personresource',
name='personid',
field=models.ForeignKey(db_column='personID', on_delete=django.db.models.deletion.CASCADE, to='content.People'),
),
migrations.AlterField(
model_name='personresource',
name='resourceid',
field=models.ForeignKey(db_column='resourceID', on_delete=django.db.models.deletion.CASCADE, to='content.Resources'),
),
migrations.AlterField(
model_name='resources',
name='type',
field=models.IntegerField(choices=[(1, 'Resources'), (2, 'Images'), (3, 'Links')]),
),
]