Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix project document type #287

Merged
merged 1 commit into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions datahub/investment/migrations/0007_fix_doc_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-06 13:44
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('investment', '0006_add_investemnt_document'),
]

operations = [
migrations.AlterField(
model_name='iprojectdocument',
name='doc_type',
field=models.CharField(choices=[('actual_land_date', 'Actual land date'), ('fdi_type', 'Fdi type'), ('operations_commenced', 'Operations commenced'), ('total_investment', 'Total investment'), ('foreign_equity_investment', 'Foreign equity investment'), ('number_new_jobs', 'Number new jobs'), ('number_safeguarded_jobs', 'Number safeguarded jobs'), ('r_and_d_budget', 'R and D budget'), ('new_tech_to_uk', 'New tech to uk'), ('export_revenue', 'Export revenue'), ('average_salary', 'Average salary')], max_length=255),
),
migrations.RunSQL(
sql=(
"UPDATE investment_iprojectdocument "
"SET doc_type = 'number_safeguarded_jobs' "
"WHERE doc_type = 'number_safeguarded jobs'"
),
reverse_sql=(
"UPDATE investment_iprojectdocument "
"SET doc_type = 'number_safeguarded jobs' "
"WHERE doc_type = 'number_safeguarded_jobs'"
),
elidable=True,
),
]
2 changes: 1 addition & 1 deletion datahub/investment/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class IProjectDocument(BaseModel, ArchivableModel):
('total_investment', 'Total investment'),
('foreign_equity_investment', 'Foreign equity investment'),
('number_new_jobs', 'Number new jobs'),
('number_safeguarded jobs', 'Number safeguarded jobs'),
('number_safeguarded_jobs', 'Number safeguarded jobs'),
('r_and_d_budget', 'R and D budget'),
('new_tech_to_uk', 'New tech to uk'),
('export_revenue', 'Export revenue'),
Expand Down