Coverage for crateweb/research/migrations/0003_patientexplorer_patientexploreraudit.py: 100%
8 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/research/migrations/0003_patientexplorer_patientexploreraudit.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**Research app, migration 0003.**
28"""
30# Generated by Django 1.9.8 on 2017-02-06 16:17
31from __future__ import unicode_literals
33from django.conf import settings
34from django.db import migrations, models
35import django.db.models.deletion
37# noinspection PyPackageRequirements
38import picklefield.fields
41class Migration(migrations.Migration):
43 dependencies = [
44 migrations.swappable_dependency(settings.AUTH_USER_MODEL),
45 ("research", "0002_auto_20170203_1348"),
46 ]
48 operations = [
49 migrations.CreateModel(
50 name="PatientExplorer",
51 fields=[
52 ("id", models.AutoField(primary_key=True, serialize=False)),
53 (
54 "patient_multiquery",
55 picklefield.fields.PickledObjectField(
56 editable=False,
57 null=True,
58 verbose_name="Pickled PatientMultiQuery",
59 ),
60 ),
61 ("active", models.BooleanField(default=True)),
62 ("created", models.DateTimeField(auto_now_add=True)),
63 (
64 "deleted",
65 models.BooleanField(
66 default=False,
67 verbose_name=(
68 "Deleted from the user's perspective. Audited"
69 " queries are never properly deleted."
70 ),
71 ),
72 ),
73 ("audited", models.BooleanField(default=False)),
74 (
75 "user",
76 models.ForeignKey(
77 on_delete=django.db.models.deletion.CASCADE,
78 to=settings.AUTH_USER_MODEL,
79 ),
80 ),
81 ],
82 ),
83 migrations.CreateModel(
84 name="PatientExplorerAudit",
85 fields=[
86 ("id", models.AutoField(primary_key=True, serialize=False)),
87 ("when", models.DateTimeField(auto_now_add=True)),
88 ("count_only", models.BooleanField(default=False)),
89 ("n_records", models.IntegerField(default=0)),
90 ("failed", models.BooleanField(default=False)),
91 ("fail_msg", models.TextField()),
92 (
93 "patient_explorer",
94 models.ForeignKey(
95 on_delete=django.db.models.deletion.PROTECT,
96 to="research.PatientExplorer",
97 ),
98 ),
99 ],
100 ),
101 ]