diff --git a/api/omb_eregs/settings.py b/api/omb_eregs/settings.py index 7202ece05..8fd68bdc9 100644 --- a/api/omb_eregs/settings.py +++ b/api/omb_eregs/settings.py @@ -38,7 +38,6 @@ INSTALLED_APPS = ( 'document', 'reqs.apps.ReqsConfig', - 'taggit', 'django.contrib.contenttypes', # must be after taggit and contenttypes, but before auth 'ereqs_admin.apps.EreqsAdminConfig', diff --git a/api/reqs/migrations/0001_initial.py b/api/reqs/migrations/0001_initial.py deleted file mode 100644 index 5a57f8bb1..000000000 --- a/api/reqs/migrations/0001_initial.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-24 16:33 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Requirement', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('policy_number', models.CharField(max_length=16)), - ('policy_title', models.CharField(max_length=1024)), - ('uri_policy_id', models.CharField(max_length=256)), - ('omb_policy_id', models.CharField(max_length=16)), - ('policy_type', models.CharField(max_length=32)), - ('policy_issuance_year', models.CharField(max_length=32)), - ('policy_subset', models.CharField(max_length=32)), - ('req_id', models.CharField(max_length=16)), - ('issuing_body', models.CharField(max_length=512)), - ('policy_section', models.CharField(max_length=1024)), - ('policy_sub_section', models.CharField(max_length=1024)), - ('req_text', models.TextField()), - ('verb', models.CharField(max_length=1024)), - ('impacted_entity', models.CharField(max_length=1024)), - ('req_deadline', models.CharField(max_length=128)), - ('citation', models.CharField(max_length=1024)), - ('aquisition', models.BooleanField(default=False)), - ('human_capital', models.BooleanField(default=False)), - ('cloud', models.BooleanField(default=False)), - ('data_centers', models.BooleanField(default=False)), - ('cybersecurity', models.BooleanField(default=False)), - ('privacy', models.BooleanField(default=False)), - ('shared_services', models.BooleanField(default=False)), - ('it_project_management', models.BooleanField(default=False)), - ('software', models.BooleanField(default=False)), - ('digital_services', models.BooleanField(default=False)), - ('mobile', models.BooleanField(default=False)), - ('hardware', models.BooleanField(default=False)), - ('transparency', models.BooleanField(default=False)), - ('statistics', models.BooleanField(default=False)), - ('customer_services', models.BooleanField(default=False)), - ('governance', models.BooleanField(default=False)), - ('financial_systems', models.BooleanField(default=False)), - ('budget', models.BooleanField(default=False)), - ('governance_org_structure', models.BooleanField(default=False)), - ('governance_implementation', models.BooleanField(default=False)), - ('data_management', models.BooleanField(default=False)), - ('definitions', models.BooleanField(default=False)), - ('reporting', models.BooleanField(default=False)), - ('other_keywords', models.CharField(max_length=1024)), - ], - ), - ] diff --git a/api/reqs/migrations/0001_squashed_0040_auto_20170616_1501.py b/api/reqs/migrations/0001_squashed_0040_auto_20170616_1501.py index 3d48c8114..c823fd123 100644 --- a/api/reqs/migrations/0001_squashed_0040_auto_20170616_1501.py +++ b/api/reqs/migrations/0001_squashed_0040_auto_20170616_1501.py @@ -6,7 +6,6 @@ from django.db import migrations, models import django.db.migrations.operations.special import django.db.models.deletion -import taggit.managers class Migration(migrations.Migration): diff --git a/api/reqs/migrations/0002_auto_20170125_1917.py b/api/reqs/migrations/0002_auto_20170125_1917.py deleted file mode 100644 index b15d76a6f..000000000 --- a/api/reqs/migrations/0002_auto_20170125_1917.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-25 19:17 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='requirement', - name='omb_policy_id', - field=models.CharField(blank=True, max_length=16), - ), - ] diff --git a/api/reqs/migrations/0003_auto_20170125_1917.py b/api/reqs/migrations/0003_auto_20170125_1917.py deleted file mode 100644 index f05bbff99..000000000 --- a/api/reqs/migrations/0003_auto_20170125_1917.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-25 19:17 -from __future__ import unicode_literals - -from django.db import migrations - - -def forward(apps, schema_editor): - Requirement = apps.get_model('reqs', 'Requirement') - Requirement.objects.filter(omb_policy_id='NA').update(omb_policy_id='') - Requirement.objects.filter(omb_policy_id='None').update(omb_policy_id='') - - -class Migration(migrations.Migration): - dependencies = [('reqs', '0002_auto_20170125_1917') ] - operations = [migrations.RunPython(forward)] diff --git a/api/reqs/migrations/0004_auto_20170125_2041.py b/api/reqs/migrations/0004_auto_20170125_2041.py deleted file mode 100644 index 55c4cecdc..000000000 --- a/api/reqs/migrations/0004_auto_20170125_2041.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-25 20:41 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0003_auto_20170125_1917'), - ] - - operations = [ - migrations.AlterField( - model_name='requirement', - name='policy_type', - field=models.CharField(choices=[('memorandum', 'Memorandum'), ('circular', 'Circular'), ('strategy', 'Strategy'), ('review', 'Policy Review')], max_length=32), - ), - ] diff --git a/api/reqs/migrations/0005_auto_20170125_2043.py b/api/reqs/migrations/0005_auto_20170125_2043.py deleted file mode 100644 index aaa78fb57..000000000 --- a/api/reqs/migrations/0005_auto_20170125_2043.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-25 20:43 -from __future__ import unicode_literals - -from django.db import migrations - - -def forward(apps, schema_editor): - Requirement = apps.get_model('reqs', 'Requirement') - Requirement.objects.filter(policy_type__icontains='memo').update( - policy_type='Memorandum') - - -class Migration(migrations.Migration): - dependencies = [('reqs', '0004_auto_20170125_2041')] - operations = [migrations.RunPython(forward)] diff --git a/api/reqs/migrations/0006_auto_20170127_0037.py b/api/reqs/migrations/0006_auto_20170127_0037.py deleted file mode 100644 index 131740986..000000000 --- a/api/reqs/migrations/0006_auto_20170127_0037.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-27 00:37 -from __future__ import unicode_literals - -import datetime -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0005_auto_20170125_2043'), - ] - - operations = [ - migrations.AddField( - model_name='requirement', - name='policy_issuance', - field=models.DateField(default=datetime.date(2001, 1, 1)), - preserve_default=False, - ), - migrations.AddField( - model_name='requirement', - name='policy_sunset', - field=models.DateField(blank=True, null=True), - ), - ] diff --git a/api/reqs/migrations/0007_auto_20170127_0001.py b/api/reqs/migrations/0007_auto_20170127_0001.py deleted file mode 100644 index 8888574d5..000000000 --- a/api/reqs/migrations/0007_auto_20170127_0001.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-27 00:01 -from __future__ import unicode_literals - -import logging -from datetime import datetime - -from django.db import migrations - - -logger = logging.getLogger(__name__) - - -def forward(apps, schema_editor): - for req in apps.get_model('reqs', 'Requirement').objects.all(): - try: - req.policy_issuance = datetime.strptime( - req.policy_issuance_year, '%m/%d/%Y').date() - - if req.policy_subset not in ('NA', 'None specified'): - req.policy_sunset = datetime.strptime( - req.policy_subset, '%m/%d/%Y').date() - except ValueError: - logger.warning('Invalid date. Removing requirement %s', req.req_id) - req.delete() - - -def backward(apps, schema_editor): - for req in apps.get_model('req', 'Requirement').objects.all(): - req.policy_issuance_year = req.policy_issuance.strftime('%m/%d/%Y') - req.policy_subset = req.policy_sunset.strftime('%m/%d/%Y') - - -class Migration(migrations.Migration): - dependencies = [('reqs', '0006_auto_20170127_0037')] - operations = [migrations.RunPython(forward, backward)] diff --git a/api/reqs/migrations/0008_auto_20170127_0039.py b/api/reqs/migrations/0008_auto_20170127_0039.py deleted file mode 100644 index 68f9a386b..000000000 --- a/api/reqs/migrations/0008_auto_20170127_0039.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-27 00:39 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0007_auto_20170127_0001'), - ] - - operations = [ - migrations.RemoveField( - model_name='requirement', - name='policy_issuance_year', - ), - migrations.RemoveField( - model_name='requirement', - name='policy_subset', - ), - ] diff --git a/api/reqs/migrations/0009_auto_20170127_2104.py b/api/reqs/migrations/0009_auto_20170127_2104.py deleted file mode 100644 index c7ceaee20..000000000 --- a/api/reqs/migrations/0009_auto_20170127_2104.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-27 21:04 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0008_auto_20170127_0039'), - ] - - operations = [ - migrations.CreateModel( - name='Policy', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('policy_number', models.IntegerField(unique=True)), - ('title', models.CharField(max_length=1024)), - ('uri', models.CharField(max_length=256)), - ('omb_policy_id', models.CharField(blank=True, max_length=16)), - ('policy_type', models.CharField(choices=[('memorandum', 'Memorandum'), ('circular', 'Circular'), ('strategy', 'Strategy'), ('review', 'Policy Review')], max_length=32)), - ('issuance', models.DateField()), - ('sunset', models.DateField(blank=True, null=True)), - ], - ), - migrations.AddField( - model_name='requirement', - name='policy', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='reqs.Policy'), - ), - ] diff --git a/api/reqs/migrations/0010_auto_20170127_1819.py b/api/reqs/migrations/0010_auto_20170127_1819.py deleted file mode 100644 index abf8f83a6..000000000 --- a/api/reqs/migrations/0010_auto_20170127_1819.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-27 18:19 -from __future__ import unicode_literals - -import logging - -from django.db import migrations -from django.forms.models import model_to_dict - - -logger = logging.getLogger(__name__) - - -def forward(apps, schema_editor): - Policy = apps.get_model('reqs', 'Policy') - Requirement = apps.get_model('reqs', 'Requirement') - policy_datas = Requirement.objects.values( - 'policy_number', 'policy_title', 'uri_policy_id', 'omb_policy_id', - 'policy_type', 'policy_issuance', 'policy_sunset' - ).distinct() - - mapping = {} - for row in policy_datas: - policy_num = row['policy_number'] - if policy_num in mapping: - logger.warning('Duplicate policy number:\nPrevious %s\nNew %s', - model_to_dict(mapping[policy_num]), row) - else: - mapping[policy_num] = Policy.objects.create( - policy_number=int(policy_num), title=row['policy_title'], - uri=row['uri_policy_id'], omb_policy_id=row['omb_policy_id'], - policy_type=row['policy_type'], issuance=row['policy_issuance'], - sunset=row['policy_sunset'] - ) - - for policy_number, policy in mapping.items(): - Requirement.objects.filter(policy_number=policy_number).update( - policy_id=policy.pk) - - -def backward(apps, schema_editor): - Requirement = apps.get_model('reqs', 'Requirement') - for req in Requirement.objects.prefetch_related('policy'): - req.policy_number = str(req.policy.policy_number) - req.policy_title = req.policy.title - req.uri_policy_id = req.policy.uri - req.omb_policy_id = req.policy.omb_policy_id - req.policy_type = req.policy.policy_type - req.policy_issuance = req.policy.issuance - req.policy_sunset = req.policy.sunset - - req.save() - - -class Migration(migrations.Migration): - dependencies = [('reqs', '0009_auto_20170127_2104')] - operations = [migrations.RunPython(forward, backward)] diff --git a/api/reqs/migrations/0011_auto_20170127_2213.py b/api/reqs/migrations/0011_auto_20170127_2213.py deleted file mode 100644 index 86189a82d..000000000 --- a/api/reqs/migrations/0011_auto_20170127_2213.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-27 22:13 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0010_auto_20170127_1819'), - ] - - operations = [ - migrations.RemoveField( - model_name='requirement', - name='omb_policy_id', - ), - migrations.RemoveField( - model_name='requirement', - name='policy_issuance', - ), - migrations.RemoveField( - model_name='requirement', - name='policy_number', - ), - migrations.RemoveField( - model_name='requirement', - name='policy_sunset', - ), - migrations.RemoveField( - model_name='requirement', - name='policy_title', - ), - migrations.RemoveField( - model_name='requirement', - name='policy_type', - ), - migrations.RemoveField( - model_name='requirement', - name='uri_policy_id', - ), - ] diff --git a/api/reqs/migrations/0012_auto_20170131_1827.py b/api/reqs/migrations/0012_auto_20170131_1827.py deleted file mode 100644 index be6a2c38c..000000000 --- a/api/reqs/migrations/0012_auto_20170131_1827.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-31 18:27 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import taggit.managers - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0011_auto_20170127_2213'), - ] - - operations = [ - migrations.CreateModel( - name='Keyword', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100, unique=True, verbose_name='Name')), - ('slug', models.SlugField(max_length=100, unique=True, verbose_name='Slug')), - ], - options={ - 'verbose_name_plural': 'Tags', - 'verbose_name': 'Keyword', - }, - ), - migrations.CreateModel( - name='KeywordConnect', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('content_object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='reqs.Requirement')), - ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='keyword', to='reqs.Keyword')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddField( - model_name='requirement', - name='keywords', - field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='reqs.KeywordConnect', to='reqs.Keyword', verbose_name='Keywords'), - ), - ] diff --git a/api/reqs/migrations/0013_auto_20170131_1829.py b/api/reqs/migrations/0013_auto_20170131_1829.py deleted file mode 100644 index ca1998503..000000000 --- a/api/reqs/migrations/0013_auto_20170131_1829.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-01-31 18:29 -from __future__ import unicode_literals - -from django.db import migrations -from django.template.defaultfilters import slugify - - -attr_to_keyword = dict( - aquisition='Acquisition/Contracts', - human_capital='Human Capital', - cloud='Cloud', - data_centers='Data Centers', - cybersecurity='Cybersecurity', - privacy='Privacy', - shared_services='Shared Services', - it_project_management='IT Project Management', - software='Software', - digital_services='Digital Services', - mobile='Mobile', - hardware='Hardware/Government Furnished Equipment (GFE)', - transparency='IT Transparency (Open Data, FOIA, Public Records, etc.)', - statistics='Agency Statistics', - customer_services='Customer Services', - governance='Governance', - financial_systems='Financial Systems', - budget='Budget', - governance_org_structure='Governance - Org Structure', - governance_implementation='Governance - Implementation', - data_management='Data Management/Standards', - definitions='Definitions', - reporting='Reporting' -) -keyword_to_attr = {keyword:attr for attr, keyword in attr_to_keyword.items()} - - -# copy-pasted to ensure migrations are consistent over time -def priority_split(text, *splitters): - """When we don't know which character is being used to combine text, run - through a list of potential splitters and split on the first""" - present = [s for s in splitters if s in text] - # fall back to non-present splitter; ensures we have a splitter - splitters = present + list(splitters) - splitter = splitters[0] - return [seg.strip() for seg in text.split(splitter) if seg.strip()] - - -def forward(apps, schema_editor): - Keyword = apps.get_model('reqs', 'Keyword') - KeywordConnect = apps.get_model('reqs', 'KeywordConnect') - Requirement = apps.get_model('reqs', 'Requirement') - keyword_cache, connections = {}, [] - for req in Requirement.objects.all(): - req_keywords = [] - for field_name, tag_name in attr_to_keyword.items(): - if getattr(req, field_name): - req_keywords.append(tag_name) - req_keywords.extend(priority_split(req.other_keywords, ';', ',')) - for keyword in req_keywords: - kw_slug = slugify(keyword) - if kw_slug not in keyword_cache: - keyword_cache[kw_slug] = Keyword.objects.create( - name=keyword, slug=kw_slug) - connections.append(KeywordConnect( - tag=keyword_cache[kw_slug], content_object=req)) - KeywordConnect.objects.bulk_create(connections) - - -def backward(apps, schema_editor): - Keyword = apps.get_model('reqs', 'Keyword') - KeywordConnect = apps.get_model('reqs', 'KeywordConnect') - connections = KeywordConnect.objects.prefetch_related('tag', - 'content_object') - for conn in connections: - if conn.tag.name in keyword_to_attr: - setattr(conn.content_object, keyword_to_attr[conn.tag.name], True) - else: - other_keywords = [ - kw.strip() - for kw in conn.content_object.other_keywords.split(';') - if kw.strip() - ] - other_keywords.append(conn.tag.name) - conn.content_object.other_keywords = ';'.join(other_keywords) - conn.content_object.save() - KeywordConnect.objects.all().delete() - Keyword.objects.all().delete() - - -class Migration(migrations.Migration): - dependencies = [('reqs', '0012_auto_20170131_1827')] - operations = [migrations.RunPython(forward, backward)] diff --git a/api/reqs/migrations/0014_auto_20170201_0006.py b/api/reqs/migrations/0014_auto_20170201_0006.py deleted file mode 100644 index a38282e5c..000000000 --- a/api/reqs/migrations/0014_auto_20170201_0006.py +++ /dev/null @@ -1,111 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-01 00:06 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0013_auto_20170131_1829'), - ] - - operations = [ - migrations.RemoveField( - model_name='requirement', - name='aquisition', - ), - migrations.RemoveField( - model_name='requirement', - name='budget', - ), - migrations.RemoveField( - model_name='requirement', - name='cloud', - ), - migrations.RemoveField( - model_name='requirement', - name='customer_services', - ), - migrations.RemoveField( - model_name='requirement', - name='cybersecurity', - ), - migrations.RemoveField( - model_name='requirement', - name='data_centers', - ), - migrations.RemoveField( - model_name='requirement', - name='data_management', - ), - migrations.RemoveField( - model_name='requirement', - name='definitions', - ), - migrations.RemoveField( - model_name='requirement', - name='digital_services', - ), - migrations.RemoveField( - model_name='requirement', - name='financial_systems', - ), - migrations.RemoveField( - model_name='requirement', - name='governance', - ), - migrations.RemoveField( - model_name='requirement', - name='governance_implementation', - ), - migrations.RemoveField( - model_name='requirement', - name='governance_org_structure', - ), - migrations.RemoveField( - model_name='requirement', - name='hardware', - ), - migrations.RemoveField( - model_name='requirement', - name='human_capital', - ), - migrations.RemoveField( - model_name='requirement', - name='it_project_management', - ), - migrations.RemoveField( - model_name='requirement', - name='mobile', - ), - migrations.RemoveField( - model_name='requirement', - name='other_keywords', - ), - migrations.RemoveField( - model_name='requirement', - name='privacy', - ), - migrations.RemoveField( - model_name='requirement', - name='reporting', - ), - migrations.RemoveField( - model_name='requirement', - name='shared_services', - ), - migrations.RemoveField( - model_name='requirement', - name='software', - ), - migrations.RemoveField( - model_name='requirement', - name='statistics', - ), - migrations.RemoveField( - model_name='requirement', - name='transparency', - ), - ] diff --git a/api/reqs/migrations/0015_auto_20170214_1529.py b/api/reqs/migrations/0015_auto_20170214_1529.py deleted file mode 100644 index 7dcb0f891..000000000 --- a/api/reqs/migrations/0015_auto_20170214_1529.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-14 15:29 -from __future__ import unicode_literals - -import logging - -from django.db import migrations -from django.db.models.aggregates import Count - -logger = logging.getLogger(__name__) - - -def forward(apps, schema_editor): - """Delete any duplicate req_ids""" - Requirement = apps.get_model('reqs', 'Requirement') - query = Requirement.objects.values_list('req_id').annotate( - count=Count('req_id')).filter(count__gt=1).order_by('req_id') - for req_id, count in query: - logger.warning('Req Id %s appears %s times. Deleting extras.', - req_id, count) - dupes = Requirement.objects.filter(req_id=req_id).order_by('pk')[1:] - for dup in dupes: - dup.delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0014_auto_20170201_0006'), - ] - - operations = [ - migrations.RunPython(forward, migrations.RunPython.noop) - ] diff --git a/api/reqs/migrations/0016_auto_20170214_1551.py b/api/reqs/migrations/0016_auto_20170214_1551.py deleted file mode 100644 index 33275c788..000000000 --- a/api/reqs/migrations/0016_auto_20170214_1551.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-14 15:51 -from __future__ import unicode_literals - -from django.db import migrations, models -import taggit.managers - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0015_auto_20170214_1529'), - ] - - operations = [ - migrations.AlterModelOptions( - name='keyword', - options={'verbose_name': 'Keyword', 'verbose_name_plural': 'Keywords'}, - ), - migrations.AlterModelOptions( - name='policy', - options={'ordering': ['policy_number'], 'verbose_name_plural': 'Policies'}, - ), - migrations.AlterModelOptions( - name='requirement', - options={'ordering': ['req_id']}, - ), - migrations.AlterField( - model_name='requirement', - name='keywords', - field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='reqs.KeywordConnect', to='reqs.Keyword', verbose_name='Keywords'), - ), - migrations.AlterField( - model_name='requirement', - name='req_id', - field=models.CharField(max_length=16, unique=True), - ), - ] diff --git a/api/reqs/migrations/0017_auto_20170222_2019.py b/api/reqs/migrations/0017_auto_20170222_2019.py deleted file mode 100644 index 4a349f6f5..000000000 --- a/api/reqs/migrations/0017_auto_20170222_2019.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-22 20:19 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0016_auto_20170214_1551'), - ] - - operations = [ - migrations.AddField( - model_name='policy', - name='policy_status', - field=models.CharField(blank=True, max_length=32), - ), - migrations.AddField( - model_name='requirement', - name='omb_data_collection', - field=models.CharField(blank=True, max_length=1024), - ), - migrations.AddField( - model_name='requirement', - name='precedent', - field=models.CharField(blank=True, max_length=1024), - ), - migrations.AddField( - model_name='requirement', - name='related_reqs', - field=models.CharField(blank=True, max_length=1024), - ), - migrations.AddField( - model_name='requirement', - name='req_status', - field=models.CharField(blank=True, max_length=32), - ), - ] diff --git a/api/reqs/migrations/0018_auto_20170228_1727.py b/api/reqs/migrations/0018_auto_20170228_1727.py deleted file mode 100644 index 75d06d139..000000000 --- a/api/reqs/migrations/0018_auto_20170228_1727.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-28 17:27 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0017_auto_20170222_2019'), - ] - - operations = [ - migrations.AlterField( - model_name='policy', - name='omb_policy_id', - field=models.CharField(blank=True, max_length=64), - ), - migrations.AlterField( - model_name='policy', - name='policy_type', - field=models.CharField(blank=True, choices=[('memorandum', 'Memorandum'), ('circular', 'Circular'), ('strategy', 'Strategy'), ('review', 'Policy Review'), ('executive', 'Executive Order'), ('guidance', 'Guidance'), ('standards', 'Standards'), ('law', 'Law'), ('plan', 'Plan'), ('hspd', 'HSPD'), ('ppd', 'PPD'), ('national_action', 'National Action Plan')], max_length=32), - ), - migrations.AlterField( - model_name='requirement', - name='impacted_entity', - field=models.CharField(max_length=8192), - ), - migrations.AlterField( - model_name='requirement', - name='req_deadline', - field=models.CharField(max_length=512), - ), - ] diff --git a/api/reqs/migrations/0018_auto_20170307_1554.py b/api/reqs/migrations/0018_auto_20170307_1554.py deleted file mode 100644 index 31be73c1a..000000000 --- a/api/reqs/migrations/0018_auto_20170307_1554.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-07 15:54 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0017_auto_20170222_2019'), - ] - - operations = [ - migrations.AlterModelOptions( - name='keyword', - options={'ordering': ['name'], 'verbose_name': 'Keyword', 'verbose_name_plural': 'Keywords'}, - ), - ] diff --git a/api/reqs/migrations/0019_merge_20170307_2232.py b/api/reqs/migrations/0019_merge_20170307_2232.py deleted file mode 100644 index 438b773f2..000000000 --- a/api/reqs/migrations/0019_merge_20170307_2232.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-07 22:32 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0018_auto_20170307_1554'), - ('reqs', '0018_auto_20170228_1727'), - ] - - operations = [ - ] diff --git a/api/reqs/migrations/0020_auto_20170307_2246.py b/api/reqs/migrations/0020_auto_20170307_2246.py deleted file mode 100644 index 26010a503..000000000 --- a/api/reqs/migrations/0020_auto_20170307_2246.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-07 22:46 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0019_merge_20170307_2232'), - ] - - operations = [ - migrations.AlterField( - model_name='policy', - name='policy_type', - field=models.CharField(blank=True, choices=[('circular', 'Circular'), ('executive', 'Executive Order'), ('guidance', 'Guidance'), ('hspd', 'HSPD'), ('law', 'Law'), ('memorandum', 'Memorandum'), ('national_action', 'National Action Plan'), ('plan', 'Plan'), ('ppd', 'PPD'), ('review', 'Policy Review'), ('standards', 'Standards'), ('strategy', 'Strategy')], max_length=32), - ), - ] diff --git a/api/reqs/migrations/0021_auto_20170321_2251.py b/api/reqs/migrations/0021_auto_20170321_2251.py deleted file mode 100644 index 47e70416c..000000000 --- a/api/reqs/migrations/0021_auto_20170321_2251.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-21 22:51 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0020_auto_20170307_2246'), - ] - - operations = [ - migrations.AlterField( - model_name='policy', - name='policy_status', - field=models.CharField(blank=True, max_length=256), - ), - ] diff --git a/api/reqs/migrations/0022_auto_20170329_1719.py b/api/reqs/migrations/0022_auto_20170329_1719.py deleted file mode 100644 index 05b200f0f..000000000 --- a/api/reqs/migrations/0022_auto_20170329_1719.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-03-29 17:19 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0021_auto_20170321_2251'), - ] - - operations = [ - migrations.AlterField( - model_name='requirement', - name='citation', - field=models.CharField(blank=True, max_length=1024), - ), - migrations.AlterField( - model_name='requirement', - name='impacted_entity', - field=models.CharField(blank=True, max_length=8192), - ), - migrations.AlterField( - model_name='requirement', - name='policy', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='reqs.Policy'), - ), - migrations.AlterField( - model_name='requirement', - name='policy_section', - field=models.CharField(blank=True, max_length=1024), - ), - migrations.AlterField( - model_name='requirement', - name='policy_sub_section', - field=models.CharField(blank=True, max_length=1024), - ), - migrations.AlterField( - model_name='requirement', - name='req_deadline', - field=models.CharField(blank=True, max_length=512), - ), - migrations.AlterField( - model_name='requirement', - name='verb', - field=models.CharField(blank=True, max_length=1024), - ), - ] diff --git a/api/reqs/migrations/0023_auto_20170418_1751.py b/api/reqs/migrations/0023_auto_20170418_1751.py deleted file mode 100644 index 1ff17a966..000000000 --- a/api/reqs/migrations/0023_auto_20170418_1751.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.7 on 2017-04-18 17:51 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import taggit.managers - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0022_auto_20170329_1719'), - ] - - operations = [ - migrations.RemoveField( - model_name='requirement', - name='keywords', - ), - migrations.RenameModel( - old_name='KeywordConnect', - new_name='TopicConnect', - ), - migrations.RenameModel( - old_name='Keyword', - new_name='Topic', - ), - migrations.AlterModelOptions( - name='topic', - options={'ordering': ['name'], 'verbose_name': 'Topic', 'verbose_name_plural': 'Topics'}, - ), - migrations.AddField( - model_name='requirement', - name='topics', - field=taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='reqs.TopicConnect', to='reqs.Topic', verbose_name='Topics'), - ), - migrations.AlterField( - model_name='topicconnect', - name='tag', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='topic', to='reqs.Topic'), - ), - ] diff --git a/api/reqs/migrations/0024_auto_20170425_2317.py b/api/reqs/migrations/0024_auto_20170425_2317.py deleted file mode 100644 index ef964e0ef..000000000 --- a/api/reqs/migrations/0024_auto_20170425_2317.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-04-25 23:17 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0023_auto_20170418_1751'), - ] - - operations = [ - migrations.AlterField( - model_name='requirement', - name='policy', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requirements', to='reqs.Policy'), - ), - ] diff --git a/api/reqs/migrations/0025_policy_document_source.py b/api/reqs/migrations/0025_policy_document_source.py deleted file mode 100644 index 1f27eda07..000000000 --- a/api/reqs/migrations/0025_policy_document_source.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-02 06:57 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0024_auto_20170425_2317'), - ] - - operations = [ - migrations.AddField( - model_name='policy', - name='document_source', - field=models.FileField(blank=True, upload_to=''), - ), - ] diff --git a/api/reqs/migrations/0026_policy_nonpublic.py b/api/reqs/migrations/0026_policy_nonpublic.py deleted file mode 100644 index a06678eb0..000000000 --- a/api/reqs/migrations/0026_policy_nonpublic.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-08 23:18 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0025_policy_document_source'), - ] - - operations = [ - migrations.AddField( - model_name='policy', - name='nonpublic', - field=models.BooleanField(default=False), - ), - ] diff --git a/api/reqs/migrations/0027_auto_20170511_2111.py b/api/reqs/migrations/0027_auto_20170511_2111.py deleted file mode 100644 index 1e814ad2c..000000000 --- a/api/reqs/migrations/0027_auto_20170511_2111.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-11 21:11 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0026_policy_nonpublic'), - ] - - operations = [ - migrations.CreateModel( - name='Agency', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=256)), - ('abbr', models.CharField(blank=True, max_length=64)), - ('omb_agency_code', models.CharField(blank=True, max_length=8)), - ('nonpublic', models.BooleanField(default=False)), - ], - ), - migrations.CreateModel( - name='AgencyGroup', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=256)), - ('slug', models.CharField(blank=True, max_length=64)), - ], - ), - migrations.AddField( - model_name='agency', - name='groups', - field=models.ManyToManyField(to='reqs.AgencyGroup'), - ), - ] diff --git a/api/reqs/migrations/0028_auto_20170516_2117.py b/api/reqs/migrations/0028_auto_20170516_2117.py deleted file mode 100644 index a18d341c6..000000000 --- a/api/reqs/migrations/0028_auto_20170516_2117.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-16 21:17 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0027_auto_20170511_2111'), - ] - - operations = [ - migrations.AddField( - model_name='requirement', - name='agencies', - field=models.ManyToManyField(to='reqs.Agency'), - ), - migrations.AddField( - model_name='requirement', - name='agency_groups', - field=models.ManyToManyField(to='reqs.AgencyGroup'), - ), - ] diff --git a/api/reqs/migrations/0029_auto_20170517_2024.py b/api/reqs/migrations/0029_auto_20170517_2024.py deleted file mode 100644 index 53a99aad3..000000000 --- a/api/reqs/migrations/0029_auto_20170517_2024.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-17 20:24 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0028_auto_20170516_2117'), - ] - - operations = [ - migrations.RemoveField( - model_name='agency', - name='groups', - ), - migrations.AddField( - model_name='agencygroup', - name='agencies', - field=models.ManyToManyField(related_name='groups', to='reqs.Agency'), - ), - ] diff --git a/api/reqs/migrations/0030_auto_20170517_2035.py b/api/reqs/migrations/0030_auto_20170517_2035.py deleted file mode 100644 index 47c2a7420..000000000 --- a/api/reqs/migrations/0030_auto_20170517_2035.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-17 20:35 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0029_auto_20170517_2024'), - ] - - operations = [ - migrations.AlterField( - model_name='agencygroup', - name='agencies', - field=models.ManyToManyField(blank=True, related_name='groups', to='reqs.Agency'), - ), - migrations.AlterField( - model_name='requirement', - name='agencies', - field=models.ManyToManyField(blank=True, to='reqs.Agency'), - ), - migrations.AlterField( - model_name='requirement', - name='agency_groups', - field=models.ManyToManyField(blank=True, to='reqs.AgencyGroup'), - ), - ] diff --git a/api/reqs/migrations/0031_auto_20170519_1610.py b/api/reqs/migrations/0031_auto_20170519_1610.py deleted file mode 100644 index 9a6601612..000000000 --- a/api/reqs/migrations/0031_auto_20170519_1610.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-19 16:10 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0030_auto_20170517_2035'), - ] - - operations = [ - migrations.RunSQL(""" - CREATE VIEW reqs_requirement_all_agencies AS ( - --- Direct connection - (SELECT - -- prefix with letters to avoid conflicts - 'a' || id AS id, requirement_id, agency_id - FROM reqs_requirement_agencies - ) - UNION - --- Through agency groups - (SELECT - -- prefix with letters to avoid conflicts - 'g' || rrag.id || 'a' || rag.id, requirement_id, agency_id - FROM reqs_requirement_agency_groups rrag - INNER JOIN reqs_agencygroup_agencies rag - ON rrag.agencygroup_id = rag.agencygroup_id - ) - ) - """, - "DROP VIEW reqs_requirement_all_agencies" - ), - ] diff --git a/api/reqs/migrations/0031_auto_20170531_1242.py b/api/reqs/migrations/0031_auto_20170531_1242.py deleted file mode 100644 index bc12c7557..000000000 --- a/api/reqs/migrations/0031_auto_20170531_1242.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-31 12:42 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0030_auto_20170517_2035'), - ] - - operations = [ - migrations.RunSQL(""" - CREATE INDEX reqs_requirement_gin_search - ON reqs_requirement - USING GIN (to_tsvector('english', req_text)) - """, - "DROP INDEX reqs_requirement_gin_search" - ), - ] diff --git a/api/reqs/migrations/0031_auto_20170601_1631.py b/api/reqs/migrations/0031_auto_20170601_1631.py deleted file mode 100644 index 860c7300f..000000000 --- a/api/reqs/migrations/0031_auto_20170601_1631.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-01 16:31 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0030_auto_20170517_2035'), - ] - - operations = [ - migrations.AddField( - model_name='policy', - name='issuing_body', - field=models.CharField(default='', max_length=512), - preserve_default=False, - ), - ] diff --git a/api/reqs/migrations/0032_auto_20170519_1952.py b/api/reqs/migrations/0032_auto_20170519_1952.py deleted file mode 100644 index af54d2e9c..000000000 --- a/api/reqs/migrations/0032_auto_20170519_1952.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-05-19 19:52 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0031_auto_20170519_1610'), - ] - - operations = [ - migrations.CreateModel( - name='RequirementAllAgencies', - fields=[ - ('id', models.CharField(max_length=1024, primary_key=True, serialize=False)), - ], - options={ - 'managed': False, - 'db_table': 'reqs_requirement_all_agencies', - }, - ), - migrations.AlterModelOptions( - name='agency', - options={'ordering': ['name'], 'verbose_name': 'Agency', 'verbose_name_plural': 'Agencies'}, - ), - migrations.AlterModelOptions( - name='agencygroup', - options={'ordering': ['name'], 'verbose_name': 'Agency Group', 'verbose_name_plural': 'Agency Groups'}, - ), - migrations.AddField( - model_name='requirement', - name='all_agencies', - field=models.ManyToManyField(related_name='all_requirements', through='reqs.RequirementAllAgencies', to='reqs.Agency'), - ), - ] diff --git a/api/reqs/migrations/0032_auto_20170601_1633.py b/api/reqs/migrations/0032_auto_20170601_1633.py deleted file mode 100644 index 7f32b1c74..000000000 --- a/api/reqs/migrations/0032_auto_20170601_1633.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-01 16:33 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0031_auto_20170601_1631'), - ] - - operations = [ - migrations.RunSQL( - """ - UPDATE reqs_policy - SET issuing_body = ( - --- While each policy *should* have at least one - --- requirement and all requirements for a given policy - --- *should* have the same issuing body, we'll play it - --- safe and use MAX to grab lexicographically last value - --- and COALESCE to give a default when no requirements - --- are present. - SELECT COALESCE(MAX(r.issuing_body), '') - FROM reqs_requirement r - WHERE r.policy_id = reqs_policy.id - ) - """, """ - UPDATE reqs_requirement - SET issuing_body = ( - SELECT p.issuing_body - FROM reqs_policy p - WHERE reqs_requirement.policy_id = p.id - ) - """) - ] diff --git a/api/reqs/migrations/0033_auto_20170601_1753.py b/api/reqs/migrations/0033_auto_20170601_1753.py deleted file mode 100644 index 3c745a5d7..000000000 --- a/api/reqs/migrations/0033_auto_20170601_1753.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-01 17:53 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0032_auto_20170601_1633'), - ] - - operations = [ - migrations.RemoveField( - model_name='requirement', - name='issuing_body', - ), - ] diff --git a/api/reqs/migrations/0034_merge_20170605_1637.py b/api/reqs/migrations/0034_merge_20170605_1637.py deleted file mode 100644 index 48e7c70dd..000000000 --- a/api/reqs/migrations/0034_merge_20170605_1637.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-05 16:37 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0031_auto_20170531_1242'), - ('reqs', '0033_auto_20170601_1753'), - ] - - operations = [ - ] diff --git a/api/reqs/migrations/0035_merge_20170605_1903.py b/api/reqs/migrations/0035_merge_20170605_1903.py deleted file mode 100644 index 4a4a9d245..000000000 --- a/api/reqs/migrations/0035_merge_20170605_1903.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-05 19:03 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0034_merge_20170605_1637'), - ('reqs', '0032_auto_20170519_1952'), - ] - - operations = [ - ] diff --git a/api/reqs/migrations/0036_auto_20170606_1818.py b/api/reqs/migrations/0036_auto_20170606_1818.py deleted file mode 100644 index 4fcf60b7d..000000000 --- a/api/reqs/migrations/0036_auto_20170606_1818.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-06 18:18 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0035_merge_20170605_1903'), - ] - - operations = [ - migrations.CreateModel( - name='Office', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=256)), - ], - ), - migrations.AddField( - model_name='policy', - name='managing_office', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='reqs.Office'), - ), - ] diff --git a/api/reqs/migrations/0037_auto_20170613_1318.py b/api/reqs/migrations/0037_auto_20170613_1318.py deleted file mode 100644 index d4aea7b50..000000000 --- a/api/reqs/migrations/0037_auto_20170613_1318.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-13 13:18 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0036_auto_20170606_1818'), - ] - - operations = [ - migrations.AddField( - model_name='agency', - name='public', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='policy', - name='public', - field=models.BooleanField(default=True), - ), - migrations.RunSQL( - "UPDATE reqs_agency SET public = NOT nonpublic", - "UPDATE reqs_agency SET nonpublic = NOT public" - ), - migrations.RunSQL( - "UPDATE reqs_policy SET public = NOT nonpublic", - "UPDATE reqs_policy SET nonpublic = NOT public" - ), - migrations.RemoveField( - model_name='agency', - name='nonpublic', - ), - migrations.RemoveField( - model_name='policy', - name='nonpublic', - ), - ] diff --git a/api/reqs/migrations/0037_auto_20170613_1811.py b/api/reqs/migrations/0037_auto_20170613_1811.py deleted file mode 100644 index 10520d313..000000000 --- a/api/reqs/migrations/0037_auto_20170613_1811.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-13 18:11 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0036_auto_20170606_1818'), - ] - - operations = [ - migrations.AlterModelOptions( - name='topic', - options={'ordering': ['name']}, - ), - migrations.RemoveField( - model_name='requirement', - name='topics', - ), - migrations.RemoveField( - model_name='topic', - name='slug', - ), - migrations.AlterField( - model_name='topic', - name='name', - field=models.CharField(max_length=256, unique=True), - ), - ] diff --git a/api/reqs/migrations/0038_auto_20170613_1816.py b/api/reqs/migrations/0038_auto_20170613_1816.py deleted file mode 100644 index 5602734d4..000000000 --- a/api/reqs/migrations/0038_auto_20170613_1816.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-13 18:16 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0037_auto_20170613_1811'), - ] - - operations = [ - migrations.AddField( - model_name='requirement', - name='topics', - field=models.ManyToManyField(blank=True, related_name='requirements', to='reqs.Topic'), - ), - migrations.RunSQL( - """ - INSERT INTO reqs_requirement_topics (requirement_id, topic_id) - (SELECT content_object_id, tag_id - FROM reqs_topicconnect - GROUP BY content_object_id, tag_id) --- ensure uniqueness - """, """ - INSERT INTO reqs_topicconnect (content_object_id, tag_id) - (SELECT requirement_id, topic_id - FROM reqs_requirement_topics) - """ - ), - migrations.RemoveField( - model_name='topicconnect', - name='content_object', - ), - migrations.RemoveField( - model_name='topicconnect', - name='tag', - ), - migrations.DeleteModel( - name='TopicConnect', - ), - ] diff --git a/api/reqs/migrations/0038_requirement_public.py b/api/reqs/migrations/0038_requirement_public.py deleted file mode 100644 index 8e04895ef..000000000 --- a/api/reqs/migrations/0038_requirement_public.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-13 14:09 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0037_auto_20170613_1318'), - ] - - operations = [ - migrations.AddField( - model_name='requirement', - name='public', - field=models.BooleanField(default=True), - ), - ] diff --git a/api/reqs/migrations/0039_merge_20170614_1333.py b/api/reqs/migrations/0039_merge_20170614_1333.py deleted file mode 100644 index 362c15871..000000000 --- a/api/reqs/migrations/0039_merge_20170614_1333.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-14 13:33 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('reqs', '0038_requirement_public'), - ('reqs', '0038_auto_20170613_1816'), - ] - - operations = [ - ] diff --git a/api/reqs/migrations/0040_auto_20170616_1501.py b/api/reqs/migrations/0040_auto_20170616_1501.py deleted file mode 100644 index 2c630e22e..000000000 --- a/api/reqs/migrations/0040_auto_20170616_1501.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11 on 2017-06-16 15:01 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - """Mass-create new revisions for each of the req models.""" - REVISED_MODELS = [ - ('reqs', 'Agency'), - ('reqs', 'AgencyGroup'), - ('reqs', 'Office'), - ('reqs', 'Policy'), - ('reqs', 'Requirement'), - ('reqs', 'Topic'), - ] - - dependencies = [ - ('reqs', '0039_merge_20170614_1333'), - ] - - operations = [ - ] diff --git a/api/requirements.in b/api/requirements.in index 7aa709b5f..8cf999a80 100644 --- a/api/requirements.in +++ b/api/requirements.in @@ -7,7 +7,6 @@ django-cors-headers django-filter django-reversion django-storages -django-taggit # cannot remove until we squash migrations djangorestframework dj-database-url gunicorn diff --git a/api/requirements.txt b/api/requirements.txt index 366dd1d90..5e9bf9423 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -20,7 +20,6 @@ django-flat-responsive==1.4.1 # via django-admin-interface django-flat-theme==1.1.4 # via django-admin-interface django-reversion==2.0.10 django-storages==1.6.5 -django-taggit==0.22.0 django==1.11.5 djangorestframework==3.6.4 docutils==0.13.1 # via botocore diff --git a/api/requirements_dev.txt b/api/requirements_dev.txt index ce4116558..4395394fe 100644 --- a/api/requirements_dev.txt +++ b/api/requirements_dev.txt @@ -26,7 +26,6 @@ django-flat-responsive==1.4.1 django-flat-theme==1.1.4 django-reversion==2.0.10 django-storages==1.6.5 -django-taggit==0.22.0 django==1.11.5 djangorestframework==3.6.4 docopt==0.6.2 # via pytest-watch