"Fossies" - the Fresh Open Source Software Archive

Member "taiga-back-5.0.6/taiga/projects/epics/migrations/0001_initial.py" (15 Jan 2020, 4984 Bytes) of package /linux/www/taiga-back-5.0.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "0001_initial.py" see the Fossies "Dox" file reference documentation.

    1 # -*- coding: utf-8 -*-
    2 # Generated by Django 1.9.2 on 2016-07-05 11:12
    3 from __future__ import unicode_literals
    4 
    5 from django.conf import settings
    6 import django.contrib.postgres.fields
    7 from django.db import migrations, models
    8 import django.db.models.deletion
    9 import django.utils.timezone
   10 import taiga.projects.notifications.mixins
   11 
   12 
   13 class Migration(migrations.Migration):
   14 
   15     initial = True
   16 
   17     dependencies = [
   18         ('userstories', '0012_auto_20160614_1201'),
   19         ('projects', '0049_auto_20160629_1443'),
   20         ('history', '0012_auto_20160629_1036'),
   21         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
   22     ]
   23 
   24     operations = [
   25         migrations.CreateModel(
   26             name='Epic',
   27             fields=[
   28                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
   29                 ('tags', django.contrib.postgres.fields.ArrayField(base_field=models.TextField(), blank=True, default=[], null=True, size=None, verbose_name='tags')),
   30                 ('version', models.IntegerField(default=1, verbose_name='version')),
   31                 ('is_blocked', models.BooleanField(default=False, verbose_name='is blocked')),
   32                 ('blocked_note', models.TextField(blank=True, default='', verbose_name='blocked note')),
   33                 ('ref', models.BigIntegerField(blank=True, db_index=True, default=None, null=True, verbose_name='ref')),
   34                 ('epics_order', models.IntegerField(default=10000, verbose_name='epics order')),
   35                 ('created_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='created date')),
   36                 ('modified_date', models.DateTimeField(verbose_name='modified date')),
   37                 ('subject', models.TextField(verbose_name='subject')),
   38                 ('description', models.TextField(blank=True, verbose_name='description')),
   39                 ('client_requirement', models.BooleanField(default=False, verbose_name='is client requirement')),
   40                 ('team_requirement', models.BooleanField(default=False, verbose_name='is team requirement')),
   41                 ('assigned_to', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='epics_assigned_to_me', to=settings.AUTH_USER_MODEL, verbose_name='assigned to')),
   42                 ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='owned_epics', to=settings.AUTH_USER_MODEL, verbose_name='owner')),
   43                 ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='epics', to='projects.Project', verbose_name='project')),
   44                 ('status', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='epics', to='projects.EpicStatus', verbose_name='status')),
   45             ],
   46             options={
   47                 'ordering': ['project', 'epics_order', 'ref'],
   48                 'verbose_name_plural': 'epics',
   49                 'verbose_name': 'epic',
   50             },
   51             bases=(taiga.projects.notifications.mixins.WatchedModelMixin, models.Model),
   52         ),
   53         migrations.CreateModel(
   54             name='RelatedUserStory',
   55             fields=[
   56                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
   57                 ('order', models.IntegerField(default=10000, verbose_name='order')),
   58                 ('epic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='epics.Epic')),
   59                 ('user_story', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='userstories.UserStory')),
   60             ],
   61             options={
   62                 'ordering': ['user_story', 'order', 'id'],
   63                 'verbose_name_plural': 'related user stories',
   64                 'verbose_name': 'related user story',
   65             },
   66         ),
   67         migrations.AddField(
   68             model_name='epic',
   69             name='user_stories',
   70             field=models.ManyToManyField(related_name='epics', through='epics.RelatedUserStory', to='userstories.UserStory', verbose_name='user stories'),
   71         ),
   72         # Execute trigger after epic update
   73         migrations.RunSQL(
   74             """
   75             DROP TRIGGER IF EXISTS update_project_tags_colors_on_epic_update ON epics_epic;
   76             CREATE TRIGGER update_project_tags_colors_on_epic_update
   77             AFTER UPDATE ON epics_epic
   78             FOR EACH ROW EXECUTE PROCEDURE update_project_tags_colors();
   79             """
   80         ),
   81         # Execute trigger after epic insert
   82         migrations.RunSQL(
   83             """
   84             DROP TRIGGER IF EXISTS update_project_tags_colors_on_epic_insert ON epics_epic;
   85             CREATE TRIGGER update_project_tags_colors_on_epic_insert
   86             AFTER INSERT ON epics_epic
   87             FOR EACH ROW EXECUTE PROCEDURE update_project_tags_colors();
   88             """
   89         ),
   90     ]