Coverage for crateweb/consent/migrations/0009_auto_20180629_1132.py: 100%
4 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-08-27 10:34 -0500
« prev ^ index » next coverage.py v7.8.0, created at 2025-08-27 10:34 -0500
1"""
2crate_anon/crateweb/consent/migrations/0009_auto_20180629_1132.py
4===============================================================================
6 Copyright (C) 2015, University of Cambridge, Department of Psychiatry.
7 Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
9 This file is part of CRATE.
11 CRATE is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 CRATE is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with CRATE. If not, see <https://www.gnu.org/licenses/>.
24===============================================================================
26**Consent app, migration 0009.**
28"""
30# Generated by Django 2.0.6 on 2018-06-29 11:32
32from django.db import migrations, models
35class Migration(migrations.Migration):
37 dependencies = [
38 ("consent", "0008_auto_20170507_1218"),
39 ]
41 operations = [
42 # ClinicianResponse
43 migrations.AddField(
44 model_name="clinicianresponse",
45 name="processed",
46 field=models.BooleanField(default=False),
47 ),
48 migrations.RunSQL(
49 """
50 UPDATE consent_clinicianresponse
51 SET processed = 1
52 WHERE created_at < '2018-06-01'
53 """
54 ),
55 migrations.AddField(
56 model_name="clinicianresponse",
57 name="processed_at",
58 field=models.DateTimeField(null=True),
59 ),
60 # ContactRequest
61 migrations.AddField(
62 model_name="patientresponse",
63 name="processed",
64 field=models.BooleanField(default=False),
65 ),
66 migrations.RunSQL(
67 """
68 UPDATE consent_patientresponse
69 SET processed = 1
70 WHERE created_at < '2018-06-01'
71 """
72 ),
73 migrations.AddField(
74 model_name="contactrequest",
75 name="processed_at",
76 field=models.DateTimeField(null=True),
77 ),
78 # PatientResponse
79 migrations.AddField(
80 model_name="patientresponse",
81 name="processed_at",
82 field=models.DateTimeField(null=True),
83 ),
84 # Other trivial changes
85 migrations.AlterField(
86 model_name="patientlookup",
87 name="source_db",
88 field=models.CharField(
89 choices=[
90 ("dummy_clinical", "Dummy clinical database for testing"),
91 ("cpft_crs", "CPFT Care Records System (CRS) 2005-2012"),
92 (
93 "cpft_rio_rcep",
94 "CPFT RiO 2013- (preprocessed by Servelec RCEP tool)",
95 ),
96 ("cpft_rio_raw", "CPFT RiO 2013- (raw)"),
97 (
98 "cpft_rio_crate",
99 "CPFT RiO 2013- (preprocessed by CRATE)",
100 ),
101 (
102 "cpft_rio_datamart",
103 "CPFT RiO 2013- (data warehouse processed version)",
104 ),
105 ],
106 max_length=20,
107 verbose_name="Source database used for lookup",
108 ),
109 ),
110 ]