summaryrefslogtreecommitdiff
path: root/ishtar_common/migrations/0018_auto_20171017_1840.py
blob: 0c617a3d5b90c19f6f5ff094e5e6ddd504b9b4f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-10-17 18:40
from __future__ import unicode_literals

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('ishtar_common', '0017_auto_20171016_1320'),
    ]

    operations = [
        migrations.CreateModel(
            name='JsonDataField',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Name')),
                ('key', models.CharField(help_text='Value of the key in the JSON schema. For hierarchical key use "__" to explain it. For instance the key \'my_subkey\' with data such as {\'my_key\': {\'my_subkey\': \'value\'}} will be reached with my_key__my_subkey.', max_length=200, verbose_name='Key')),
                ('display', models.BooleanField(default=True, verbose_name='Display')),
                ('order', models.IntegerField(default=10, verbose_name='Order')),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'verbose_name': 'Json data - Field',
                'verbose_name_plural': 'Json data - Fields',
            },
        ),
        migrations.CreateModel(
            name='JsonDataSection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Name')),
                ('order', models.IntegerField(default=10, verbose_name='Order')),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'Json data - Menu',
                'verbose_name_plural': 'Json data - Menus',
            },
        ),
        migrations.AddField(
            model_name='historicalorganization',
            name='data',
            field=django.contrib.postgres.fields.jsonb.JSONField(db_index=True, default={}),
        ),
        migrations.AddField(
            model_name='historicalperson',
            name='data',
            field=django.contrib.postgres.fields.jsonb.JSONField(db_index=True, default={}),
        ),
        migrations.AddField(
            model_name='organization',
            name='data',
            field=django.contrib.postgres.fields.jsonb.JSONField(db_index=True, default={}),
        ),
        migrations.AddField(
            model_name='person',
            name='data',
            field=django.contrib.postgres.fields.jsonb.JSONField(db_index=True, default={}),
        ),
        migrations.AddField(
            model_name='jsondatafield',
            name='section',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='ishtar_common.JsonDataSection'),
        ),
    ]