Apply some fixes over epic custom attributes
parent
e2f6245fbb
commit
15aa7da858
|
@ -26,7 +26,8 @@ class Migration(migrations.Migration):
|
|||
WHERE "key" <> ALL ("keys_to_delete")),
|
||||
'{}')::json $function$;
|
||||
""",
|
||||
reverse_sql="""DROP FUNCTION IF EXISTS "json_object_delete_keys"("json" json, VARIADIC "keys_to_delete" text[])
|
||||
reverse_sql="""
|
||||
DROP FUNCTION IF EXISTS "json_object_delete_keys"("json" json, VARIADIC "keys_to_delete" text[])
|
||||
CASCADE;"""
|
||||
),
|
||||
|
||||
|
@ -58,7 +59,6 @@ class Migration(migrations.Migration):
|
|||
RETURN NULL;
|
||||
END; $clean_key_in_custom_attributes_values$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
"""
|
||||
),
|
||||
|
||||
|
@ -72,7 +72,8 @@ class Migration(migrations.Migration):
|
|||
CREATE TRIGGER "update_userstorycustomvalues_after_remove_userstorycustomattribute"
|
||||
AFTER DELETE ON custom_attributes_userstorycustomattribute
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE clean_key_in_custom_attributes_values('user_story_id', 'userstories_userstory', 'custom_attributes_userstorycustomattributesvalues');
|
||||
EXECUTE PROCEDURE clean_key_in_custom_attributes_values('user_story_id', 'userstories_userstory',
|
||||
'custom_attributes_userstorycustomattributesvalues');
|
||||
"""
|
||||
),
|
||||
|
||||
|
@ -86,7 +87,8 @@ class Migration(migrations.Migration):
|
|||
CREATE TRIGGER "update_taskcustomvalues_after_remove_taskcustomattribute"
|
||||
AFTER DELETE ON custom_attributes_taskcustomattribute
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE clean_key_in_custom_attributes_values('task_id', 'tasks_task', 'custom_attributes_taskcustomattributesvalues');
|
||||
EXECUTE PROCEDURE clean_key_in_custom_attributes_values('task_id', 'tasks_task',
|
||||
'custom_attributes_taskcustomattributesvalues');
|
||||
"""
|
||||
),
|
||||
|
||||
|
@ -100,7 +102,8 @@ class Migration(migrations.Migration):
|
|||
CREATE TRIGGER "update_issuecustomvalues_after_remove_issuecustomattribute"
|
||||
AFTER DELETE ON custom_attributes_issuecustomattribute
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE clean_key_in_custom_attributes_values('issue_id', 'issues_issue', 'custom_attributes_issuecustomattributesvalues');
|
||||
EXECUTE PROCEDURE clean_key_in_custom_attributes_values('issue_id', 'issues_issue',
|
||||
'custom_attributes_issuecustomattributesvalues');
|
||||
"""
|
||||
),
|
||||
migrations.AlterIndexTogether(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.2 on 2016-06-30 08:49
|
||||
# Generated by Django 1.9.2 on 2016-07-28 10:02
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
@ -11,12 +11,13 @@ import django_pgjson.fields
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('epics', '0001_initial'),
|
||||
('projects', '0049_auto_20160629_1443'),
|
||||
('custom_attributes', '0007_auto_20160208_1751'),
|
||||
('epics', '0002_epic_color'),
|
||||
('projects', '0050_project_epics_csv_uuid'),
|
||||
('custom_attributes', '0008_auto_20160728_0540'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
# Change some verbose names
|
||||
migrations.AlterModelOptions(
|
||||
name='issuecustomattributesvalues',
|
||||
options={'ordering': ['id'], 'verbose_name': 'issue custom attributes values', 'verbose_name_plural': 'issue custom attributes values'},
|
||||
|
@ -29,7 +30,7 @@ class Migration(migrations.Migration):
|
|||
name='userstorycustomattributesvalues',
|
||||
options={'ordering': ['id'], 'verbose_name': 'user story custom attributes values', 'verbose_name_plural': 'user story custom attributes values'},
|
||||
),
|
||||
|
||||
# Custom attributes for epics
|
||||
migrations.CreateModel(
|
||||
name='EpicCustomAttribute',
|
||||
fields=[
|
||||
|
@ -43,10 +44,10 @@ class Migration(migrations.Migration):
|
|||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='epiccustomattributes', to='projects.Project', verbose_name='project')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'epic custom attributes',
|
||||
'verbose_name': 'epic custom attribute',
|
||||
'abstract': False,
|
||||
'ordering': ['project', 'order', 'name'],
|
||||
'verbose_name_plural': 'epic custom attributes',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
|
@ -58,24 +59,27 @@ class Migration(migrations.Migration):
|
|||
('epic', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='custom_attributes_values', to='epics.Epic', verbose_name='epic')),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'epic custom attributes values',
|
||||
'verbose_name': 'epic custom attributes values',
|
||||
'abstract': False,
|
||||
'verbose_name': 'epic custom attributes values',
|
||||
'ordering': ['id'],
|
||||
'verbose_name_plural': 'epic custom attributes values',
|
||||
},
|
||||
),
|
||||
migrations.AlterIndexTogether(
|
||||
name='epiccustomattributesvalues',
|
||||
index_together=set([('epic',)]),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='epiccustomattribute',
|
||||
unique_together=set([('project', 'name')]),
|
||||
),
|
||||
|
||||
# Trigger: Clean epiccustomattributes values before remove a epiccustomattribute
|
||||
migrations.RunSQL(
|
||||
"""
|
||||
CREATE TRIGGER "update_epiccustomvalues_after_remove_epiccustomattribute"
|
||||
AFTER DELETE ON custom_attributes_epiccustomattribute
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE clean_key_in_custom_attributes_values('custom_attributes_epiccustomattributesvalues');
|
||||
EXECUTE PROCEDURE clean_key_in_custom_attributes_values('epic_id', 'epics_epic',
|
||||
'custom_attributes_epiccustomattributesvalues');
|
||||
""",
|
||||
reverse_sql="""DROP TRIGGER IF EXISTS "update_epiccustomvalues_after_remove_epiccustomattribute"
|
||||
ON custom_attributes_epiccustomattribute
|
|
@ -106,6 +106,7 @@ class EpicCustomAttributesValues(AbstractCustomAttributesValues):
|
|||
class Meta(AbstractCustomAttributesValues.Meta):
|
||||
verbose_name = "epic custom attributes values"
|
||||
verbose_name_plural = "epic custom attributes values"
|
||||
index_together = [("epic",)]
|
||||
|
||||
@property
|
||||
def project(self):
|
||||
|
|
Loading…
Reference in New Issue