From e2d75d654cfbca06f093d830c9f2a0968d58ee71 Mon Sep 17 00:00:00 2001
From: Dan Braghis <dan.braghis@torchbox.com>
Date: Thu, 8 Mar 2018 11:15:21 +0000
Subject: [PATCH] Add a Drupal id reference field to submissions

---
 .../0027_applicationsubmission_drupal_id.py   | 20 +++++++++++++++++++
 opentech/apply/funds/models.py                |  3 +++
 2 files changed, 23 insertions(+)
 create mode 100644 opentech/apply/funds/migrations/0027_applicationsubmission_drupal_id.py

diff --git a/opentech/apply/funds/migrations/0027_applicationsubmission_drupal_id.py b/opentech/apply/funds/migrations/0027_applicationsubmission_drupal_id.py
new file mode 100644
index 000000000..fe885fc83
--- /dev/null
+++ b/opentech/apply/funds/migrations/0027_applicationsubmission_drupal_id.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.8 on 2018-03-08 11:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('funds', '0026_add_leads_to_submission_and_lab'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='applicationsubmission',
+            name='drupal_id',
+            field=models.IntegerField(blank=True, editable=False, null=True),
+        ),
+    ]
diff --git a/opentech/apply/funds/models.py b/opentech/apply/funds/models.py
index 5cc50910a..fd295a6c7 100644
--- a/opentech/apply/funds/models.py
+++ b/opentech/apply/funds/models.py
@@ -464,6 +464,9 @@ class ApplicationSubmission(WorkflowHelpers, AbstractFormSubmission):
     # Workflow inherited from WorkflowHelpers
     status = models.CharField(max_length=254)
 
+    # Meta: used for migration purposes only
+    drupal_id = models.IntegerField(null=True, blank=True, editable=False)
+
     objects = ApplicationSubmissionQueryset.as_manager()
 
     @property
-- 
GitLab