From b8b8b74f09399a83505395233b64d2badddb45a6 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 1 Sep 2020 11:25:50 +0200 Subject: [PATCH 1/5] rm RunPython --- castellum/castellum_auth/migrations/0002_user_token.py | 1 - castellum/contacts/migrations/0002_contact_subject_id.py | 1 - castellum/contacts/migrations/0004_refactor_contact_address.py | 1 - castellum/recruitment/migrations/0005_split_followup.py | 1 - .../recruitment/migrations/0006_subjectfilter_value_json.py | 1 - castellum/studies/migrations/0010_studysession_type.py | 1 - .../subjects/migrations/0015_subject_consent_onetoonefield.py | 1 - 7 files changed, 7 deletions(-) diff --git a/castellum/castellum_auth/migrations/0002_user_token.py b/castellum/castellum_auth/migrations/0002_user_token.py index bf163902d..3229b96f1 100644 --- a/castellum/castellum_auth/migrations/0002_user_token.py +++ b/castellum/castellum_auth/migrations/0002_user_token.py @@ -23,7 +23,6 @@ class Migration(migrations.Migration): name='token', field=models.CharField(max_length=64, default='empty'), ), - migrations.RunPython(set_tokens), migrations.AlterField( model_name='user', name='token', diff --git a/castellum/contacts/migrations/0002_contact_subject_id.py b/castellum/contacts/migrations/0002_contact_subject_id.py index a23fba285..87dee94c6 100644 --- a/castellum/contacts/migrations/0002_contact_subject_id.py +++ b/castellum/contacts/migrations/0002_contact_subject_id.py @@ -25,7 +25,6 @@ class Migration(migrations.Migration): name='subject_id', field=models.IntegerField(default=None, editable=False, unique=True, null=True), ), - migrations.RunPython(migrate_value), migrations.AlterField( model_name='contact', name='subject_id', diff --git a/castellum/contacts/migrations/0004_refactor_contact_address.py b/castellum/contacts/migrations/0004_refactor_contact_address.py index 88d09a1a4..d06f101e3 100644 --- a/castellum/contacts/migrations/0004_refactor_contact_address.py +++ b/castellum/contacts/migrations/0004_refactor_contact_address.py @@ -22,7 +22,6 @@ class Migration(migrations.Migration): field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='contacts.Contact', blank=True, null=True, related_name='+'), preserve_default=False, ), - migrations.RunPython(migrate_data), migrations.AlterField( model_name='address', name='contact', diff --git a/castellum/recruitment/migrations/0005_split_followup.py b/castellum/recruitment/migrations/0005_split_followup.py index 0a8bf9186..3a79daa73 100644 --- a/castellum/recruitment/migrations/0005_split_followup.py +++ b/castellum/recruitment/migrations/0005_split_followup.py @@ -41,7 +41,6 @@ class Migration(migrations.Migration): name='followup_time', field=models.TimeField(blank=True, null=True), ), - migrations.RunPython(migrate_values), migrations.RemoveField( model_name='participationrequest', name='followup', diff --git a/castellum/recruitment/migrations/0006_subjectfilter_value_json.py b/castellum/recruitment/migrations/0006_subjectfilter_value_json.py index 31b47bbea..edcc2fba6 100644 --- a/castellum/recruitment/migrations/0006_subjectfilter_value_json.py +++ b/castellum/recruitment/migrations/0006_subjectfilter_value_json.py @@ -26,7 +26,6 @@ class Migration(migrations.Migration): field=JSONField(default={}), preserve_default=False, ), - migrations.RunPython(copy_value), migrations.RemoveField( model_name='subjectfilter', name='value_old', diff --git a/castellum/studies/migrations/0010_studysession_type.py b/castellum/studies/migrations/0010_studysession_type.py index f6a91cced..68ed9e80a 100644 --- a/castellum/studies/migrations/0010_studysession_type.py +++ b/castellum/studies/migrations/0010_studysession_type.py @@ -26,7 +26,6 @@ class Migration(migrations.Migration): name='type', field=models.ManyToManyField(blank=True, to='studies.StudyType', verbose_name='Type'), ), - migrations.RunPython(migrate_data), migrations.RemoveField( model_name='study', name='study_type', diff --git a/castellum/subjects/migrations/0015_subject_consent_onetoonefield.py b/castellum/subjects/migrations/0015_subject_consent_onetoonefield.py index 830f03d1f..84f729ba5 100644 --- a/castellum/subjects/migrations/0015_subject_consent_onetoonefield.py +++ b/castellum/subjects/migrations/0015_subject_consent_onetoonefield.py @@ -23,7 +23,6 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(delete_surplus_consents), migrations.AlterField( model_name='consent', name='subject', -- GitLab From 2a0619ba95fec7d7be0e725157acf6a225ab62a8 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 1 Sep 2020 11:34:24 +0200 Subject: [PATCH 2/5] squash migrations --- .../migrations/0001_squashed_0002_initial.py | 52 +++++ .../migrations/0001_squashed_0004_initial.py | 62 ++++++ .../migrations/0001_squashed_0002_initial.py | 40 ++++ .../migrations/0001_squashed_0007_initial.py | 194 ++++++++++++++++++ .../migrations/0001_squashed_0013_initial.py | 165 +++++++++++++++ .../migrations/0001_squashed_0016_initial.py | 147 +++++++++++++ 6 files changed, 660 insertions(+) create mode 100644 castellum/castellum_auth/migrations/0001_squashed_0002_initial.py create mode 100644 castellum/contacts/migrations/0001_squashed_0004_initial.py create mode 100644 castellum/pseudonyms/migrations/0001_squashed_0002_initial.py create mode 100644 castellum/recruitment/migrations/0001_squashed_0007_initial.py create mode 100644 castellum/studies/migrations/0001_squashed_0013_initial.py create mode 100644 castellum/subjects/migrations/0001_squashed_0016_initial.py diff --git a/castellum/castellum_auth/migrations/0001_squashed_0002_initial.py b/castellum/castellum_auth/migrations/0001_squashed_0002_initial.py new file mode 100644 index 000000000..bae9bd548 --- /dev/null +++ b/castellum/castellum_auth/migrations/0001_squashed_0002_initial.py @@ -0,0 +1,52 @@ +# Generated by Django 3.0.8 on 2020-09-01 09:26 + +import castellum.castellum_auth.models +import castellum.utils.fields +import datetime +import django.contrib.auth.models +import django.contrib.auth.validators +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + replaces = [('castellum_auth', '0001_initial'), ('castellum_auth', '0002_user_token')] + + initial = True + + dependencies = [ + ('auth', '0011_update_proxy_permissions'), + ] + + operations = [ + migrations.CreateModel( + name='User', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), + ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), + ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), + ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), + ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), + ('language', models.CharField(blank=True, choices=[('de', 'German'), ('en', 'English')], max_length=5, verbose_name='Language')), + ('expiration_date', castellum.utils.fields.DateTimeField(blank=True, null=True, verbose_name='Expiration date')), + ('logout_timeout', models.DurationField(default=datetime.timedelta(seconds=900), verbose_name='Time until automatic logout')), + ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), + ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), + ('token', models.CharField(default=castellum.castellum_auth.models.generate_token, max_length=64, unique=True)), + ], + options={ + 'ordering': ['username'], + 'permissions': [('privacy_level_1', 'Can access privacy level 1'), ('privacy_level_2', 'Can access privacy level 2')], + }, + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + ] diff --git a/castellum/contacts/migrations/0001_squashed_0004_initial.py b/castellum/contacts/migrations/0001_squashed_0004_initial.py new file mode 100644 index 000000000..6cf25b7a6 --- /dev/null +++ b/castellum/contacts/migrations/0001_squashed_0004_initial.py @@ -0,0 +1,62 @@ +# Generated by Django 3.0.8 on 2020-09-01 09:26 + +import castellum.utils.fields +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + replaces = [('contacts', '0001_initial'), ('contacts', '0002_contact_subject_id'), ('contacts', '0003_subject_id_positive'), ('contacts', '0004_refactor_contact_address')] + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Contact', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateField(auto_now_add=True, verbose_name='created at')), + ('updated_at', models.DateField(auto_now=True, verbose_name='updated at')), + ('first_name', models.CharField(max_length=64, verbose_name='First name')), + ('first_name_phonetic', models.CharField(default=None, editable=False, max_length=128)), + ('last_name', models.CharField(max_length=64, verbose_name='Last name')), + ('last_name_phonetic', models.CharField(default=None, editable=False, max_length=128)), + ('title', models.CharField(blank=True, max_length=64, verbose_name='Title')), + ('gender', models.CharField(choices=[('f', 'female'), ('m', 'male'), ('*', 'diverse')], default='f', max_length=1, verbose_name='Gender')), + ('date_of_birth', castellum.utils.fields.DateField(blank=True, null=True, verbose_name='Date of birth')), + ('email', models.EmailField(blank=True, max_length=128, verbose_name='Email')), + ('phone_number', castellum.utils.fields.PhoneNumberField(blank=True, max_length=32, region=None, verbose_name='Phone number')), + ('phone_number_alternative', castellum.utils.fields.PhoneNumberField(blank=True, max_length=32, region=None, verbose_name='Phone number alternative')), + ('preferred_contact_method', models.CharField(blank=True, choices=[('phone', 'phone'), ('email', 'email'), ('postal', 'postal')], max_length=16, verbose_name='Preferred contact method')), + ('guardians', models.ManyToManyField(blank=True, related_name='guardian_of', to='contacts.Contact', verbose_name='Guardians')), + ('subject_id', models.PositiveIntegerField(default=None, editable=False, unique=True)), + ], + options={ + 'verbose_name': 'Contact', + 'verbose_name_plural': 'Contacts', + 'ordering': ['last_name', 'first_name'], + }, + ), + migrations.CreateModel( + name='Address', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('country', models.CharField(max_length=64, verbose_name='Country')), + ('city', models.CharField(max_length=128, verbose_name='City')), + ('zip_code', models.CharField(max_length=5, verbose_name='Zip code')), + ('street', models.CharField(max_length=128, verbose_name='Street')), + ('house_number', models.CharField(max_length=5, verbose_name='House number')), + ('additional_information', models.CharField(blank=True, max_length=32, verbose_name='Additional information')), + ('contact', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='contacts.Contact')), + ], + options={ + 'verbose_name': 'Address', + 'verbose_name_plural': 'Addresses', + 'ordering': ['country', 'city', 'zip_code', 'street', 'house_number', 'additional_information'], + }, + ), + ] diff --git a/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py b/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py new file mode 100644 index 000000000..71d5ad509 --- /dev/null +++ b/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py @@ -0,0 +1,40 @@ +# Generated by Django 3.0.8 on 2020-09-01 09:27 + +import castellum.utils +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + replaces = [('pseudonyms', '0001_initial'), ('pseudonyms', '0002_pseudonym_unique_subject_domain')] + + initial = True + + dependencies = [ + ('subjects', '0008_rename_consent'), + ('subjects', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Domain', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('key', models.CharField(default=castellum.utils.uuid_str, editable=False, max_length=64, unique=True)), + ('bits', models.PositiveIntegerField(default=40)), + ], + ), + migrations.CreateModel( + name='Pseudonym', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('pseudonym', models.CharField(default=None, max_length=64)), + ('domain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pseudonyms.Domain')), + ('subject', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='subjects.Subject')), + ], + options={ + 'unique_together': {('domain', 'subject'), ('domain', 'pseudonym')}, + }, + ), + ] diff --git a/castellum/recruitment/migrations/0001_squashed_0007_initial.py b/castellum/recruitment/migrations/0001_squashed_0007_initial.py new file mode 100644 index 000000000..30845a4c0 --- /dev/null +++ b/castellum/recruitment/migrations/0001_squashed_0007_initial.py @@ -0,0 +1,194 @@ +# Generated by Django 3.0.8 on 2020-09-01 09:27 + +import castellum.recruitment.models.attributesets +import castellum.utils.fields +import django.contrib.postgres.fields.jsonb +import django.core.serializers.json +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import parler.fields +import parler.models + + +class Migration(migrations.Migration): + + replaces = [('recruitment', '0001_initial'), ('recruitment', '0002_auto_20191116_1743'), ('recruitment', '0003_fullowup'), ('recruitment', '0004_attributeset_study_type_disinterest'), ('recruitment', '0005_split_followup'), ('recruitment', '0006_subjectfilter_value_json'), ('recruitment', '0007_perm_search_execution')] + + initial = True + + dependencies = [ + ('studies', '0001_initial'), + ('subjects', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='AttributeCategory', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('order', models.IntegerField(default=0)), + ], + options={ + 'verbose_name': 'Attribute category', + 'verbose_name_plural': 'Attribute categories', + 'ordering': ['order'], + }, + bases=(castellum.recruitment.models.attributesets.ImportMixin, parler.models.TranslatableModelMixin, models.Model), + ), + migrations.CreateModel( + name='AttributeDescription', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('field_type', models.CharField(choices=[('CharField', 'CharField'), ('ChoiceField', 'ChoiceField'), ('MultipleChoiceField', 'MultipleChoiceField'), ('OrderedChoiceField', 'OrderedChoiceField'), ('IntegerField', 'IntegerField'), ('BooleanField', 'BooleanField'), ('DateField', 'DateField'), ('AgeField', 'AgeField')], max_length=64)), + ('privacy_level_read', models.PositiveSmallIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(2)])), + ('privacy_level_write', models.PositiveSmallIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(2)])), + ('order', models.IntegerField(default=0)), + ('statistics_rank', models.CharField(blank=True, choices=[('primary', 'primary'), ('secondary', 'secondary')], max_length=16, null=True, unique=True)), + ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='recruitment.AttributeCategory')), + ], + options={ + 'ordering': ['order'], + }, + bases=(castellum.recruitment.models.attributesets.ImportMixin, parler.models.TranslatableModelMixin, models.Model), + ), + migrations.CreateModel( + name='ParticipationRequest', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.IntegerField(choices=[(0, 'not contacted'), (1, 'not reached'), (2, 'unsuitable'), (3, 'invited'), (4, 'follow-up scheduled'), (5, 'awaiting response')], default=0, verbose_name='Status of participation request')), + ('exclusion_criteria_checked', models.BooleanField(default=False, verbose_name='Subject may be suitable')), + ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study', verbose_name='Study')), + ('subject', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject')), + ('followup_date', castellum.utils.fields.DateField(blank=True, null=True, verbose_name='Follow-up date')), + ('followup_time', models.TimeField(blank=True, null=True, verbose_name='Follow-up time')), + ], + options={ + 'verbose_name': 'Participation request', + 'verbose_name_plural': 'Participation requests', + 'permissions': (('view_participation_pseudonyms', 'Can view participation pseudonyms'), ('search_execution', 'Can search in execution')), + 'unique_together': {('study', 'subject')}, + }, + ), + migrations.CreateModel( + name='SubjectFilterGroup', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study')), + ], + ), + migrations.CreateModel( + name='MailBatch', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='Sent date')), + ('contacted_size', models.PositiveIntegerField()), + ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study', verbose_name='Study')), + ], + ), + migrations.CreateModel( + name='AttributeChoice', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('order', models.IntegerField(default=0)), + ('description', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.AttributeDescription')), + ], + options={ + 'ordering': ['order'], + }, + bases=(castellum.recruitment.models.attributesets.ImportMixin, parler.models.TranslatableModelMixin, models.Model), + ), + migrations.CreateModel( + name='AttributeDescriptionTranslation', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')), + ('label', models.CharField(max_length=64)), + ('_filter_label', models.CharField(blank=True, default='', max_length=64)), + ('help_text', models.TextField(blank=True, default='')), + ('master', parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='recruitment.AttributeDescription')), + ], + options={ + 'verbose_name': 'attribute description Translation', + 'db_table': 'recruitment_attributedescription_translation', + 'db_tablespace': '', + 'managed': True, + 'default_permissions': (), + 'unique_together': {('language_code', 'master')}, + }, + bases=(parler.models.TranslatedFieldsModelMixin, models.Model), + ), + migrations.CreateModel( + name='AttributeChoiceTranslation', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')), + ('label', models.CharField(max_length=64)), + ('master', parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='recruitment.AttributeChoice')), + ], + options={ + 'verbose_name': 'attribute choice Translation', + 'db_table': 'recruitment_attributechoice_translation', + 'db_tablespace': '', + 'managed': True, + 'default_permissions': (), + 'unique_together': {('language_code', 'master')}, + }, + bases=(parler.models.TranslatedFieldsModelMixin, models.Model), + ), + migrations.CreateModel( + name='AttributeCategoryTranslation', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')), + ('label', models.CharField(max_length=64)), + ('master', parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='recruitment.AttributeCategory')), + ], + options={ + 'verbose_name': 'Attribute category Translation', + 'db_table': 'recruitment_attributecategory_translation', + 'db_tablespace': '', + 'managed': True, + 'default_permissions': (), + 'unique_together': {('language_code', 'master')}, + }, + bases=(parler.models.TranslatedFieldsModelMixin, models.Model), + ), + migrations.CreateModel( + name='AttributeSet', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateField(auto_now_add=True, verbose_name='created at')), + ('updated_at', models.DateField(auto_now=True, verbose_name='updated at')), + ('data', django.contrib.postgres.fields.jsonb.JSONField(encoder=django.core.serializers.json.DjangoJSONEncoder)), + ('subject', models.OneToOneField(editable=False, on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject')), + ('study_type_disinterest', models.ManyToManyField(blank=True, related_name='_attributeset_study_type_disinterest_+', to='studies.StudyType', verbose_name='Does not want to participate in the following study types:')), + ], + options={ + 'verbose_name': 'Attribute set', + 'verbose_name_plural': 'Attribute sets', + }, + ), + migrations.CreateModel( + name='ParticipationRequestRevision', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.IntegerField(choices=[(0, 'not contacted'), (1, 'not reached'), (2, 'unsuitable'), (3, 'invited'), (4, 'follow-up scheduled'), (5, 'awaiting response')], default=0)), + ('exclusion_criteria_checked', models.BooleanField()), + ('created_at', castellum.utils.fields.DateTimeField(auto_now_add=True)), + ('current', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions', to='recruitment.ParticipationRequest')), + ('followup_date', castellum.utils.fields.DateField(blank=True, null=True)), + ('followup_time', models.TimeField(blank=True, null=True)), + ], + ), + migrations.CreateModel( + name='SubjectFilter', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('operator', models.CharField(max_length=64)), + ('description', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.AttributeDescription')), + ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.SubjectFilterGroup')), + ('value', django.contrib.postgres.fields.jsonb.JSONField(default={})), + ], + ), + ] diff --git a/castellum/studies/migrations/0001_squashed_0013_initial.py b/castellum/studies/migrations/0001_squashed_0013_initial.py new file mode 100644 index 000000000..ee5dc8988 --- /dev/null +++ b/castellum/studies/migrations/0001_squashed_0013_initial.py @@ -0,0 +1,165 @@ +# Generated by Django 3.0.8 on 2020-09-01 09:27 + +import castellum.utils.fields +import castellum.utils.forms +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import parler.fields +import parler.models + + +class Migration(migrations.Migration): + + replaces = [('studies', '0001_initial'), ('studies', '0002_studytype_export_key'), ('studies', '0003_auto_20200106_1502'), ('studies', '0004_study_exclusion_critera_verbose_name'), ('studies', '0005_study_to_be_deleted_notified'), ('studies', '0006_study_min_subject_count_default'), ('studies', '0007_studysession_name_resource'), ('studies', '0008_study_type_rm_3rd_party'), ('studies', '0009_study_session_instructions'), ('studies', '0010_studysession_type'), ('studies', '0011_rm_study_expense_allowance'), ('studies', '0012_study_geo_filter'), ('studies', '0013_geojson_validator')] + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('auth', '0011_update_proxy_permissions'), + ] + + operations = [ + migrations.CreateModel( + name='Study', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=254, verbose_name='Name')), + ('contact_person', models.CharField(max_length=254, verbose_name='Responsible contact person')), + ('principal_investigator', models.CharField(max_length=254, verbose_name='Principal Investigator')), + ('affiliated_scientists', models.CharField(blank=True, max_length=254, verbose_name='Affiliated Scientists')), + ('affiliated_research_assistants', models.CharField(blank=True, max_length=254, verbose_name='Affiliated Research Assistants')), + ('description', models.TextField(blank=True, verbose_name='Description')), + ('keywords', models.CharField(blank=True, max_length=254, verbose_name='Keywords')), + ('previous_status', models.SmallIntegerField(choices=[(0, 'Edit'), (1, 'Execution'), (2, 'Finished')], default=0, verbose_name='Previous status')), + ('status', models.SmallIntegerField(choices=[(0, 'Edit'), (1, 'Execution'), (2, 'Finished')], default=0, verbose_name='Status')), + ('data_sensitivity', models.BooleanField(default=False, verbose_name='Contains sensitive data')), + ('min_subject_count', models.PositiveIntegerField(blank=True, verbose_name='Required number of subjects')), + ('expense_allowance', models.PositiveIntegerField(blank=True, null=True, verbose_name='Expense allowance')), + ('sessions_start', castellum.utils.fields.DateField(blank=True, null=True, verbose_name='Start of test sessions')), + ('sessions_end', castellum.utils.fields.DateField(blank=True, null=True, verbose_name='End of test sessions')), + ('exclusion_criteria', models.TextField(blank=True, verbose_name='Inclusion/exclusion criteria')), + ('recruitment_text', models.TextField(blank=True, verbose_name='Recruitment text')), + ('domain', models.CharField(default=None, editable=False, max_length=64, unique=True)), + ('advanced_filtering', models.BooleanField(default=False, help_text='By default you can create only one filtergroup in which all the filters are joined by AND operator. Advanced filtering allows you to create multiple filtergroups which are joined by OR operator.', verbose_name='Advanced filtering')), + ('custom_filter', models.CharField(blank=True, max_length=254, verbose_name='Custom filter')), + ('is_exclusive', models.BooleanField(default=False, help_text='When set, this ensures that potential subjects for this study will not be recruited in other studies. Please note that this may hinder other researchers in finding enough participants.', verbose_name='Exclusive subjects')), + ('complete_matches_only', models.BooleanField(default=False, help_text='By default, filters may include subjects with incomplete attribute sets. This feature is supposed to improve the quality of the database by asking recruiters to fill missing values on the go. Only allowing complete filter matches can speed up individual recruitments but may deteriorate the quality of the database as a whole. Furthermore, this reduces the number of potential subjects.', verbose_name='Complete filter matches only')), + ('consent', castellum.utils.fields.RestrictedFileField(blank=True, upload_to='studies/consent/', verbose_name='Consent')), + ('mail_subject', models.CharField(blank=True, max_length=254, verbose_name='E-mail subject')), + ('mail_body', models.TextField(blank=True, verbose_name='E-mail body')), + ('mail_reply_address', models.EmailField(blank=True, max_length=128, verbose_name='Reply e-mail-address')), + ('excluded_studies', models.ManyToManyField(blank=True, related_name='_study_excluded_studies_+', to='studies.Study', verbose_name='Excluded studies')), + ], + options={ + 'ordering': ['name'], + 'permissions': [('access_study', 'Can access studies')], + }, + ), + migrations.CreateModel( + name='StudyType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('exclusion_criteria', models.TextField(blank=True, verbose_name='Additional subject characteristics that should be verified during recruitment')), + ('data_sensitivity', models.BooleanField(default=False, verbose_name='Contains sensitive data')), + ('export_key', models.CharField(blank=True, choices=[('Online', 'Online'), ('Behavioral lab', 'Behavioral lab'), ('MRI', 'MRI'), ('Simulation', 'Simulation'), ('EEG', 'EEG')], max_length=32, verbose_name='Export key')), + ], + options={ + 'abstract': False, + }, + bases=(parler.models.TranslatableModelMixin, models.Model), + ), + migrations.CreateModel( + name='StudyMembership', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('groups', models.ManyToManyField(blank=True, related_name='_studymembership_groups_+', to='auth.Group')), + ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'unique_together': {('study', 'user')}, + }, + ), + migrations.AddField( + model_name='study', + name='members', + field=models.ManyToManyField(through='studies.StudyMembership', to=settings.AUTH_USER_MODEL), + ), + migrations.CreateModel( + name='StudyTypeTranslation', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')), + ('label', models.CharField(max_length=64, verbose_name='Label')), + ('master', parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='studies.StudyType')), + ], + options={ + 'verbose_name': 'study type Translation', + 'db_table': 'studies_studytype_translation', + 'db_tablespace': '', + 'managed': True, + 'default_permissions': (), + 'unique_together': {('language_code', 'master')}, + }, + bases=(parler.models.TranslatedFieldsModelMixin, models.Model), + ), + migrations.AlterField( + model_name='study', + name='mail_body', + field=models.TextField(blank=True, help_text='Any "{firstname}" and "{lastname}"-tags included in the e-mail-body will automatically be replaced with the first and last name of the subject.', verbose_name='E-mail body'), + ), + migrations.AlterField( + model_name='study', + name='exclusion_criteria', + field=models.TextField(blank=True, verbose_name='Additional subject characteristics that should be verified during recruitment'), + ), + migrations.AddField( + model_name='study', + name='to_be_deleted_notified', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='study', + name='min_subject_count', + field=models.PositiveIntegerField(default=0, verbose_name='Required number of subjects'), + ), + migrations.CreateModel( + name='Resource', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=128, verbose_name='Name')), + ], + ), + migrations.AddField( + model_name='study', + name='session_instructions', + field=models.TextField(blank=True, help_text='Please describe any requirements for carrying out the sessions listed below. For example, specify time intervals between sessions that need to be considered for booking appointments.', verbose_name='Session instructions'), + ), + migrations.CreateModel( + name='StudySession', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('duration', models.PositiveIntegerField(verbose_name='Duration of a session in minutes')), + ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study')), + ('name', models.CharField(default='session', max_length=128, verbose_name='Name')), + ('resource', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='studies.Resource', verbose_name='Resource')), + ('type', models.ManyToManyField(blank=True, to='studies.StudyType', verbose_name='Type')), + ], + ), + migrations.RemoveField( + model_name='study', + name='expense_allowance', + ), + migrations.AlterField( + model_name='study', + name='recruitment_text', + field=models.TextField(blank=True, help_text='This text will be used during recruitment dialogue. Thus, please describe the study from the perspective of recruiters and potential participants: What is it about? How long will it take? Are there any potential benefits or risks for participants? If applicable, also present the amount of expense allowance and related requirements.', verbose_name='Recruitment text'), + ), + migrations.AddField( + model_name='study', + name='geo_filter', + field=castellum.utils.fields.RestrictedFileField(blank=True, help_text='A GeoJSON file that contains only a single (multi)polygon. Only subjects who live inside this polygon will be considered for this study.', upload_to='studies/geofilters/', validators=[castellum.utils.forms.JsonFileValidator({'$defs': {'Feature': {'properties': {'geometry': {'oneOf': [{'$ref': '#/$defs/Polygon'}, {'$ref': '#/$defs/MultiPolygon'}]}, 'properties': {'oneOf': [{'type': 'null'}, {'type': 'object'}]}, 'type': {'enum': ['Feature'], 'type': 'string'}}, 'required': ['type', 'properties', 'geometry'], 'type': 'object'}, 'MultiPolygon': {'properties': {'coordinates': {'items': {'$ref': '#/$defs/MultiPolygon'}, 'type': 'array'}, 'type': {'enum': ['MultiPolygon'], 'type': 'string'}}, 'required': ['type', 'coordinates'], 'type': 'object'}, 'Polygon': {'properties': {'coordinates': {'$ref': '#/$defs/PolygonCoordinates'}, 'type': {'enum': ['Polygon'], 'type': 'string'}}, 'required': ['type', 'coordinates'], 'type': 'object'}, 'PolygonCoordinates': {'items': {'items': {'items': {'type': 'number'}, 'minItems': 2, 'type': 'array'}, 'minItems': 4, 'type': 'array'}, 'type': 'array'}}, '$schema': 'http://json-schema.org/draft-07/schema#'}, '#/$defs/Feature')], verbose_name='Geo filter file'), + ), + ] diff --git a/castellum/subjects/migrations/0001_squashed_0016_initial.py b/castellum/subjects/migrations/0001_squashed_0016_initial.py new file mode 100644 index 000000000..762bf388e --- /dev/null +++ b/castellum/subjects/migrations/0001_squashed_0016_initial.py @@ -0,0 +1,147 @@ +# Generated by Django 3.0.8 on 2020-09-01 09:27 + +import castellum.utils.fields +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + replaces = [('subjects', '0001_initial'), ('subjects', '0002_subject_to_be_deleted_notified'), ('subjects', '0003_subject_to_be_deleted_help_texts'), ('subjects', '0004_subject_to_be_deleted_date'), ('subjects', '0005_subject_export_requested'), ('subjects', '0006_exportanswer'), ('subjects', '0007_consent_is_current'), ('subjects', '0008_rename_consent'), ('subjects', '0009_subject_source'), ('subjects', '0010_remove_consent_type'), ('subjects', '0011_remove_consentdocument_info'), ('subjects', '0012_consentdocument_file_optional'), ('subjects', '0013_rename_consentdocument_is_valid'), ('subjects', '0014_remove_subject_no_recruitment'), ('subjects', '0015_subject_consent_onetoonefield'), ('subjects', '0016_consentdocument_is_deprecated')] + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Subject', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateField(auto_now_add=True, verbose_name='created at')), + ('updated_at', models.DateField(auto_now=True, verbose_name='updated at')), + ('privacy_level', models.PositiveIntegerField(choices=[(0, '0 (regular)'), (1, '1 (increased)'), (2, '2 (high)')], default=0, verbose_name='Privacy level')), + ('no_recruitment', models.BooleanField(default=False, verbose_name='Do not contact for recruitment')), + ('to_be_deleted', models.DateTimeField(blank=True, null=True, verbose_name='To be deleted')), + ('note_hard_of_hearing', models.BooleanField(default=False, verbose_name='Hard of hearing')), + ('note_difficult_to_understand', models.BooleanField(default=False, verbose_name='Difficult to understand')), + ('note_abusive_language', models.BooleanField(default=False, verbose_name='Abusive language')), + ('not_available_until', castellum.utils.fields.DateTimeField(blank=True, null=True, verbose_name='not available until')), + ], + options={ + 'verbose_name': 'Subject', + }, + ), + migrations.CreateModel( + name='TimeSlot', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('hour', models.PositiveSmallIntegerField(verbose_name='hour')), + ], + options={ + 'ordering': ['hour'], + }, + ), + migrations.CreateModel( + name='SubjectNote', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('content', models.CharField(blank=True, max_length=128, verbose_name='Content')), + ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject')), + ], + ), + migrations.AddField( + model_name='subject', + name='availability_friday', + field=models.ManyToManyField(blank=True, related_name='_subject_availability_friday_+', to='subjects.TimeSlot', verbose_name='Friday'), + ), + migrations.AddField( + model_name='subject', + name='availability_monday', + field=models.ManyToManyField(blank=True, related_name='_subject_availability_monday_+', to='subjects.TimeSlot', verbose_name='Monday'), + ), + migrations.AddField( + model_name='subject', + name='availability_thursday', + field=models.ManyToManyField(blank=True, related_name='_subject_availability_thursday_+', to='subjects.TimeSlot', verbose_name='Thursday'), + ), + migrations.AddField( + model_name='subject', + name='availability_tuesday', + field=models.ManyToManyField(blank=True, related_name='_subject_availability_tuesday_+', to='subjects.TimeSlot', verbose_name='Tuesday'), + ), + migrations.AddField( + model_name='subject', + name='availability_wednesday', + field=models.ManyToManyField(blank=True, related_name='_subject_availability_wednesday_+', to='subjects.TimeSlot', verbose_name='Wednesday'), + ), + migrations.AddField( + model_name='subject', + name='to_be_deleted_notified', + field=models.BooleanField(default=False), + ), + migrations.RemoveField( + model_name='subject', + name='no_recruitment', + ), + migrations.AlterField( + model_name='subject', + name='to_be_deleted', + field=models.DateTimeField(blank=True, help_text='All data about this subject should be deleted or fully anonymized. This includes all data in Castellum and all data collected in studies. This option should be used when a subject requests GDPR deletion.', null=True, verbose_name='To be deleted'), + ), + migrations.AlterField( + model_name='subject', + name='to_be_deleted', + field=models.DateField(blank=True, help_text='All data about this subject should be deleted or fully anonymized. This includes all data in Castellum and all data collected in studies. This option should be used when a subject requests GDPR deletion.', null=True, verbose_name='To be deleted'), + ), + migrations.AddField( + model_name='subject', + name='export_requested', + field=models.DateField(blank=True, help_text='The subject wants to receive an export of all data we have stored about them. This includes all data in Castellum and all data collected in studies. This option should be used when a subject requests GDPR export.', null=True, verbose_name='Export requested'), + ), + migrations.CreateModel( + name='ExportAnswer', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateField(auto_now_add=True, verbose_name='Created at')), + ('created_by', models.CharField(max_length=150, verbose_name='Created by')), + ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject')), + ], + options={ + 'verbose_name': 'Export answer', + }, + ), + migrations.AddField( + model_name='subject', + name='source', + field=models.CharField(blank=True, max_length=128, verbose_name='Data source'), + ), + migrations.CreateModel( + name='Consent', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')), + ('status', models.CharField(choices=[('waiting', 'Waiting for confirmation'), ('confirmed', 'Confirmed')], max_length=64, verbose_name='Status')), + ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.Consent')), + ('subject', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject')), + ], + options={ + 'verbose_name': 'Consent', + 'get_latest_by': 'document__created_at', + }, + ), + migrations.CreateModel( + name='ConsentDocument', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')), + ('file', castellum.utils.fields.RestrictedFileField(blank=True, upload_to='consent/', verbose_name='File')), + ('is_valid', models.BooleanField(default=True, verbose_name='Is valid')), + ('is_deprecated', models.BooleanField(default=False, verbose_name='Is deprecated')), + ], + options={ + 'get_latest_by': 'created_at', + }, + ), + ] -- GitLab From 38bd9264821b2af175f673ebf7175c14856cbe0f Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 1 Sep 2020 11:38:31 +0200 Subject: [PATCH 3/5] delete old migrations --- .../castellum_auth/migrations/0001_initial.py | 48 ----- .../migrations/0002_user_token.py | 31 ---- castellum/contacts/migrations/0001_initial.py | 60 ------- .../migrations/0002_contact_subject_id.py | 37 ---- .../migrations/0003_subject_id_positive.py | 18 -- .../0004_refactor_contact_address.py | 34 ---- .../pseudonyms/migrations/0001_initial.py | 37 ---- .../0002_pseudonym_unique_subject_domain.py | 18 -- .../recruitment/migrations/0001_initial.py | 168 ------------------ .../migrations/0002_auto_20191116_1743.py | 100 ----------- .../recruitment/migrations/0003_fullowup.py | 29 --- ...004_attributeset_study_type_disinterest.py | 19 -- .../migrations/0005_split_followup.py | 52 ------ .../0006_subjectfilter_value_json.py | 33 ---- .../migrations/0007_perm_search_execution.py | 17 -- castellum/studies/migrations/0001_initial.py | 117 ------------ .../migrations/0002_studytype_export_key.py | 18 -- .../migrations/0003_auto_20200106_1502.py | 18 -- ...04_study_exclusion_critera_verbose_name.py | 23 --- .../0005_study_to_be_deleted_notified.py | 18 -- .../0006_study_min_subject_count_default.py | 18 -- .../0007_studysession_name_resource.py | 32 ---- .../0008_study_type_rm_3rd_party.py | 18 -- .../0009_study_session_instructions.py | 18 -- .../migrations/0010_studysession_type.py | 33 ---- .../0011_rm_study_expense_allowance.py | 22 --- .../migrations/0012_study_geo_filter.py | 19 -- .../migrations/0013_geojson_validator.py | 20 --- castellum/subjects/migrations/0001_initial.py | 104 ----------- .../0002_subject_to_be_deleted_notified.py | 18 -- .../0003_subject_to_be_deleted_help_texts.py | 23 --- .../0004_subject_to_be_deleted_date.py | 18 -- .../0005_subject_export_requested.py | 18 -- .../subjects/migrations/0006_exportanswer.py | 26 --- .../migrations/0007_consent_is_current.py | 18 -- .../migrations/0008_rename_consent.py | 34 ---- .../migrations/0009_subject_source.py | 18 -- .../migrations/0010_remove_consent_type.py | 17 -- .../0011_remove_consentdocument_info.py | 17 -- .../0012_consentdocument_file_optional.py | 19 -- .../0013_rename_consentdocument_is_valid.py | 24 --- .../0014_remove_subject_no_recruitment.py | 17 -- .../0015_subject_consent_onetoonefield.py | 31 ---- .../0016_consentdocument_is_deprecated.py | 18 -- 44 files changed, 1495 deletions(-) delete mode 100644 castellum/castellum_auth/migrations/0001_initial.py delete mode 100644 castellum/castellum_auth/migrations/0002_user_token.py delete mode 100644 castellum/contacts/migrations/0001_initial.py delete mode 100644 castellum/contacts/migrations/0002_contact_subject_id.py delete mode 100644 castellum/contacts/migrations/0003_subject_id_positive.py delete mode 100644 castellum/contacts/migrations/0004_refactor_contact_address.py delete mode 100644 castellum/pseudonyms/migrations/0001_initial.py delete mode 100644 castellum/pseudonyms/migrations/0002_pseudonym_unique_subject_domain.py delete mode 100644 castellum/recruitment/migrations/0001_initial.py delete mode 100644 castellum/recruitment/migrations/0002_auto_20191116_1743.py delete mode 100644 castellum/recruitment/migrations/0003_fullowup.py delete mode 100644 castellum/recruitment/migrations/0004_attributeset_study_type_disinterest.py delete mode 100644 castellum/recruitment/migrations/0005_split_followup.py delete mode 100644 castellum/recruitment/migrations/0006_subjectfilter_value_json.py delete mode 100644 castellum/recruitment/migrations/0007_perm_search_execution.py delete mode 100644 castellum/studies/migrations/0001_initial.py delete mode 100644 castellum/studies/migrations/0002_studytype_export_key.py delete mode 100644 castellum/studies/migrations/0003_auto_20200106_1502.py delete mode 100644 castellum/studies/migrations/0004_study_exclusion_critera_verbose_name.py delete mode 100644 castellum/studies/migrations/0005_study_to_be_deleted_notified.py delete mode 100644 castellum/studies/migrations/0006_study_min_subject_count_default.py delete mode 100644 castellum/studies/migrations/0007_studysession_name_resource.py delete mode 100644 castellum/studies/migrations/0008_study_type_rm_3rd_party.py delete mode 100644 castellum/studies/migrations/0009_study_session_instructions.py delete mode 100644 castellum/studies/migrations/0010_studysession_type.py delete mode 100644 castellum/studies/migrations/0011_rm_study_expense_allowance.py delete mode 100644 castellum/studies/migrations/0012_study_geo_filter.py delete mode 100644 castellum/studies/migrations/0013_geojson_validator.py delete mode 100644 castellum/subjects/migrations/0001_initial.py delete mode 100644 castellum/subjects/migrations/0002_subject_to_be_deleted_notified.py delete mode 100644 castellum/subjects/migrations/0003_subject_to_be_deleted_help_texts.py delete mode 100644 castellum/subjects/migrations/0004_subject_to_be_deleted_date.py delete mode 100644 castellum/subjects/migrations/0005_subject_export_requested.py delete mode 100644 castellum/subjects/migrations/0006_exportanswer.py delete mode 100644 castellum/subjects/migrations/0007_consent_is_current.py delete mode 100644 castellum/subjects/migrations/0008_rename_consent.py delete mode 100644 castellum/subjects/migrations/0009_subject_source.py delete mode 100644 castellum/subjects/migrations/0010_remove_consent_type.py delete mode 100644 castellum/subjects/migrations/0011_remove_consentdocument_info.py delete mode 100644 castellum/subjects/migrations/0012_consentdocument_file_optional.py delete mode 100644 castellum/subjects/migrations/0013_rename_consentdocument_is_valid.py delete mode 100644 castellum/subjects/migrations/0014_remove_subject_no_recruitment.py delete mode 100644 castellum/subjects/migrations/0015_subject_consent_onetoonefield.py delete mode 100644 castellum/subjects/migrations/0016_consentdocument_is_deprecated.py diff --git a/castellum/castellum_auth/migrations/0001_initial.py b/castellum/castellum_auth/migrations/0001_initial.py deleted file mode 100644 index 5e097b035..000000000 --- a/castellum/castellum_auth/migrations/0001_initial.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 2.2.6 on 2019-11-16 16:43 - -import castellum.utils.fields -import datetime -import django.contrib.auth.models -import django.contrib.auth.validators -from django.db import migrations, models -import django.utils.timezone - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('auth', '0011_update_proxy_permissions'), - ] - - operations = [ - migrations.CreateModel( - name='User', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('password', models.CharField(max_length=128, verbose_name='password')), - ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), - ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), - ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), - ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), - ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), - ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), - ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), - ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), - ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), - ('language', models.CharField(blank=True, choices=[('de', 'German'), ('en', 'English')], max_length=5, verbose_name='Language')), - ('expiration_date', castellum.utils.fields.DateTimeField(blank=True, null=True, verbose_name='Expiration date')), - ('logout_timeout', models.DurationField(default=datetime.timedelta(0, 900), verbose_name='Time until automatic logout')), - ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), - ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), - ], - options={ - 'ordering': ['username'], - 'permissions': [('privacy_level_1', 'Can access privacy level 1'), ('privacy_level_2', 'Can access privacy level 2')], - }, - managers=[ - ('objects', django.contrib.auth.models.UserManager()), - ], - ), - ] diff --git a/castellum/castellum_auth/migrations/0002_user_token.py b/castellum/castellum_auth/migrations/0002_user_token.py deleted file mode 100644 index 3229b96f1..000000000 --- a/castellum/castellum_auth/migrations/0002_user_token.py +++ /dev/null @@ -1,31 +0,0 @@ -# See also https://stackoverflow.com/questions/42496655 - -import castellum.castellum_auth.models -from django.db import migrations, models - - -def set_tokens(apps, schema_editor): - User = apps.get_model('castellum_auth', 'User') - for user in User.objects.all(): - user.token = castellum.castellum_auth.models.generate_token() - user.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ('castellum_auth', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='user', - name='token', - field=models.CharField(max_length=64, default='empty'), - ), - migrations.AlterField( - model_name='user', - name='token', - field=models.CharField(default=castellum.castellum_auth.models.generate_token, max_length=64, unique=True), - ), - ] diff --git a/castellum/contacts/migrations/0001_initial.py b/castellum/contacts/migrations/0001_initial.py deleted file mode 100644 index 022d0267c..000000000 --- a/castellum/contacts/migrations/0001_initial.py +++ /dev/null @@ -1,60 +0,0 @@ -# Generated by Django 2.2.6 on 2019-11-16 16:43 - -import castellum.utils.fields -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Address', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('country', models.CharField(max_length=64, verbose_name='Country')), - ('city', models.CharField(max_length=128, verbose_name='City')), - ('zip_code', models.CharField(max_length=5, verbose_name='Zip code')), - ('street', models.CharField(max_length=128, verbose_name='Street')), - ('house_number', models.CharField(max_length=5, verbose_name='House number')), - ('additional_information', models.CharField(blank=True, max_length=32, verbose_name='Additional information')), - ], - options={ - 'verbose_name': 'Address', - 'verbose_name_plural': 'Addresses', - 'ordering': ['country', 'city', 'zip_code', 'street', 'house_number', 'additional_information'], - }, - ), - migrations.CreateModel( - name='Contact', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateField(auto_now_add=True, verbose_name='created at')), - ('updated_at', models.DateField(auto_now=True, verbose_name='updated at')), - ('pseudonym', models.CharField(default=None, editable=False, max_length=64, unique=True)), - ('first_name', models.CharField(max_length=64, verbose_name='First name')), - ('first_name_phonetic', models.CharField(default=None, editable=False, max_length=128)), - ('last_name', models.CharField(max_length=64, verbose_name='Last name')), - ('last_name_phonetic', models.CharField(default=None, editable=False, max_length=128)), - ('title', models.CharField(blank=True, max_length=64, verbose_name='Title')), - ('gender', models.CharField(choices=[('f', 'female'), ('m', 'male'), ('*', 'diverse')], default='f', max_length=1, verbose_name='Gender')), - ('date_of_birth', castellum.utils.fields.DateField(blank=True, null=True, verbose_name='Date of birth')), - ('email', models.EmailField(blank=True, max_length=128, verbose_name='Email')), - ('phone_number', castellum.utils.fields.PhoneNumberField(blank=True, max_length=32, region=None, verbose_name='Phone number')), - ('phone_number_alternative', castellum.utils.fields.PhoneNumberField(blank=True, max_length=32, region=None, verbose_name='Phone number alternative')), - ('preferred_contact_method', models.CharField(blank=True, choices=[('phone', 'phone'), ('email', 'email'), ('postal', 'postal')], max_length=16, verbose_name='Preferred contact method')), - ('address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='contacts.Address', verbose_name='Address')), - ('guardians', models.ManyToManyField(blank=True, related_name='guardian_of', to='contacts.Contact', verbose_name='Guardians')), - ], - options={ - 'verbose_name': 'Contact', - 'verbose_name_plural': 'Contacts', - 'ordering': ['last_name', 'first_name'], - }, - ), - ] diff --git a/castellum/contacts/migrations/0002_contact_subject_id.py b/castellum/contacts/migrations/0002_contact_subject_id.py deleted file mode 100644 index 87dee94c6..000000000 --- a/castellum/contacts/migrations/0002_contact_subject_id.py +++ /dev/null @@ -1,37 +0,0 @@ -from django.conf import settings -from django.db import migrations, models - -from castellum.pseudonyms.helpers import get_subject - - -def migrate_value(apps, schema_editor): - Contact = apps.get_model('contacts', 'Contact') - for contact in Contact.objects.all(): - domain = settings.CASTELLUM_DOMAINS['contact']['key'] - subject = get_subject(domain, contact.pseudonym) - contact.subject_id = subject.pk - contact.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ('contacts', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='contact', - name='subject_id', - field=models.IntegerField(default=None, editable=False, unique=True, null=True), - ), - migrations.AlterField( - model_name='contact', - name='subject_id', - field=models.IntegerField(default=None, editable=False, unique=True), - ), - migrations.RemoveField( - model_name='contact', - name='pseudonym', - ), - ] diff --git a/castellum/contacts/migrations/0003_subject_id_positive.py b/castellum/contacts/migrations/0003_subject_id_positive.py deleted file mode 100644 index d492e6175..000000000 --- a/castellum/contacts/migrations/0003_subject_id_positive.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.4 on 2020-03-16 17:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('contacts', '0002_contact_subject_id'), - ] - - operations = [ - migrations.AlterField( - model_name='contact', - name='subject_id', - field=models.PositiveIntegerField(default=None, editable=False, unique=True), - ), - ] diff --git a/castellum/contacts/migrations/0004_refactor_contact_address.py b/castellum/contacts/migrations/0004_refactor_contact_address.py deleted file mode 100644 index d06f101e3..000000000 --- a/castellum/contacts/migrations/0004_refactor_contact_address.py +++ /dev/null @@ -1,34 +0,0 @@ -from django.db import migrations, models -import django.db.models.deletion - - -def migrate_data(apps, schema_editor): - Address = apps.get_model('contacts', 'Address') - for address in Address.objects.all(): - address.contact = address.contact_set.get() - address.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ('contacts', '0003_subject_id_positive'), - ] - - operations = [ - migrations.AddField( - model_name='address', - name='contact', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='contacts.Contact', blank=True, null=True, related_name='+'), - preserve_default=False, - ), - migrations.AlterField( - model_name='address', - name='contact', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='contacts.Contact'), - ), - migrations.RemoveField( - model_name='contact', - name='address', - ), - ] diff --git a/castellum/pseudonyms/migrations/0001_initial.py b/castellum/pseudonyms/migrations/0001_initial.py deleted file mode 100644 index b9cccd293..000000000 --- a/castellum/pseudonyms/migrations/0001_initial.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 2.2.6 on 2019-11-16 16:43 - -import castellum.utils -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('subjects', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='Domain', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('key', models.CharField(default=castellum.utils.uuid_str, editable=False, max_length=64, unique=True)), - ('bits', models.PositiveIntegerField(default=40)), - ], - ), - migrations.CreateModel( - name='Pseudonym', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('pseudonym', models.CharField(default=None, max_length=64)), - ('domain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pseudonyms.Domain')), - ('subject', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='subjects.Subject')), - ], - options={ - 'unique_together': {('domain', 'pseudonym')}, - }, - ), - ] diff --git a/castellum/pseudonyms/migrations/0002_pseudonym_unique_subject_domain.py b/castellum/pseudonyms/migrations/0002_pseudonym_unique_subject_domain.py deleted file mode 100644 index b56605a7e..000000000 --- a/castellum/pseudonyms/migrations/0002_pseudonym_unique_subject_domain.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2020-03-16 14:53 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0008_rename_consent'), - ('pseudonyms', '0001_initial'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='pseudonym', - unique_together={('domain', 'pseudonym'), ('domain', 'subject')}, - ), - ] diff --git a/castellum/recruitment/migrations/0001_initial.py b/castellum/recruitment/migrations/0001_initial.py deleted file mode 100644 index 5b4d6fc7e..000000000 --- a/castellum/recruitment/migrations/0001_initial.py +++ /dev/null @@ -1,168 +0,0 @@ -# Generated by Django 2.2.6 on 2019-11-16 16:43 - -import castellum.recruitment.models.attributesets -import castellum.utils.fields -import django.contrib.postgres.fields.jsonb -import django.core.serializers.json -import django.core.validators -from django.db import migrations, models -import parler.models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='AttributeCategory', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('order', models.IntegerField(default=0)), - ], - options={ - 'verbose_name': 'Attribute category', - 'verbose_name_plural': 'Attribute categories', - 'ordering': ['order'], - }, - bases=(castellum.recruitment.models.attributesets.ImportMixin, parler.models.TranslatableModelMixin, models.Model), - ), - migrations.CreateModel( - name='AttributeCategoryTranslation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')), - ('label', models.CharField(max_length=64)), - ], - options={ - 'verbose_name': 'Attribute category Translation', - 'db_table': 'recruitment_attributecategory_translation', - 'db_tablespace': '', - 'managed': True, - 'default_permissions': (), - }, - bases=(parler.models.TranslatedFieldsModelMixin, models.Model), - ), - migrations.CreateModel( - name='AttributeChoice', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('order', models.IntegerField(default=0)), - ], - options={ - 'ordering': ['order'], - }, - bases=(castellum.recruitment.models.attributesets.ImportMixin, parler.models.TranslatableModelMixin, models.Model), - ), - migrations.CreateModel( - name='AttributeChoiceTranslation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')), - ('label', models.CharField(max_length=64)), - ], - options={ - 'verbose_name': 'attribute choice Translation', - 'db_table': 'recruitment_attributechoice_translation', - 'db_tablespace': '', - 'managed': True, - 'default_permissions': (), - }, - bases=(parler.models.TranslatedFieldsModelMixin, models.Model), - ), - migrations.CreateModel( - name='AttributeDescription', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('field_type', models.CharField(choices=[('CharField', 'CharField'), ('ChoiceField', 'ChoiceField'), ('MultipleChoiceField', 'MultipleChoiceField'), ('OrderedChoiceField', 'OrderedChoiceField'), ('IntegerField', 'IntegerField'), ('BooleanField', 'BooleanField'), ('DateField', 'DateField'), ('AgeField', 'AgeField')], max_length=64)), - ('privacy_level_read', models.PositiveSmallIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(2)])), - ('privacy_level_write', models.PositiveSmallIntegerField(default=0, validators=[django.core.validators.MaxValueValidator(2)])), - ('order', models.IntegerField(default=0)), - ('statistics_rank', models.CharField(blank=True, choices=[('primary', 'primary'), ('secondary', 'secondary')], max_length=16, null=True, unique=True)), - ], - options={ - 'ordering': ['order'], - }, - bases=(castellum.recruitment.models.attributesets.ImportMixin, parler.models.TranslatableModelMixin, models.Model), - ), - migrations.CreateModel( - name='AttributeDescriptionTranslation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')), - ('label', models.CharField(max_length=64)), - ('_filter_label', models.CharField(blank=True, default='', max_length=64)), - ('help_text', models.TextField(blank=True, default='')), - ], - options={ - 'verbose_name': 'attribute description Translation', - 'db_table': 'recruitment_attributedescription_translation', - 'db_tablespace': '', - 'managed': True, - 'default_permissions': (), - }, - bases=(parler.models.TranslatedFieldsModelMixin, models.Model), - ), - migrations.CreateModel( - name='AttributeSet', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateField(auto_now_add=True, verbose_name='created at')), - ('updated_at', models.DateField(auto_now=True, verbose_name='updated at')), - ('data', django.contrib.postgres.fields.jsonb.JSONField(encoder=django.core.serializers.json.DjangoJSONEncoder)), - ], - options={ - 'verbose_name': 'Attribute set', - 'verbose_name_plural': 'Attribute sets', - }, - ), - migrations.CreateModel( - name='MailBatch', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='Sent date')), - ('contacted_size', models.PositiveIntegerField()), - ], - ), - migrations.CreateModel( - name='ParticipationRequest', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('status', models.IntegerField(choices=[(0, 'not contacted'), (1, 'not reached'), (2, 'unsuitable'), (3, 'invited'), (4, 'follow-up scheduled'), (5, 'awaiting response')], default=0, verbose_name='Status of participation request')), - ('exclusion_criteria_checked', models.BooleanField(default=False, verbose_name='Subject may be suitable')), - ('appointment', castellum.utils.fields.DateTimeField(blank=True, null=True, verbose_name='Appointment')), - ], - options={ - 'verbose_name': 'Participation request', - 'verbose_name_plural': 'Participation requests', - 'permissions': (('view_participation_pseudonyms', 'Can view participation pseudonyms'),), - }, - ), - migrations.CreateModel( - name='ParticipationRequestRevision', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('status', models.IntegerField(choices=[(0, 'not contacted'), (1, 'not reached'), (2, 'unsuitable'), (3, 'invited'), (4, 'follow-up scheduled'), (5, 'awaiting response')], default=0)), - ('exclusion_criteria_checked', models.BooleanField()), - ('appointment', castellum.utils.fields.DateTimeField(blank=True, null=True)), - ('created_at', castellum.utils.fields.DateTimeField(auto_now_add=True)), - ], - ), - migrations.CreateModel( - name='SubjectFilter', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('operator', models.CharField(max_length=64)), - ('value', models.TextField(editable=False)), - ], - ), - migrations.CreateModel( - name='SubjectFilterGroup', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ], - ), - ] diff --git a/castellum/recruitment/migrations/0002_auto_20191116_1743.py b/castellum/recruitment/migrations/0002_auto_20191116_1743.py deleted file mode 100644 index a27c6dec6..000000000 --- a/castellum/recruitment/migrations/0002_auto_20191116_1743.py +++ /dev/null @@ -1,100 +0,0 @@ -# Generated by Django 2.2.6 on 2019-11-16 16:43 - -from django.db import migrations, models -import django.db.models.deletion -import parler.fields - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ('subjects', '0001_initial'), - ('recruitment', '0001_initial'), - ('studies', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='subjectfiltergroup', - name='study', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study'), - ), - migrations.AddField( - model_name='subjectfilter', - name='description', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.AttributeDescription'), - ), - migrations.AddField( - model_name='subjectfilter', - name='group', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.SubjectFilterGroup'), - ), - migrations.AddField( - model_name='participationrequestrevision', - name='current', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions', to='recruitment.ParticipationRequest'), - ), - migrations.AddField( - model_name='participationrequest', - name='study', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study', verbose_name='Study'), - ), - migrations.AddField( - model_name='participationrequest', - name='subject', - field=models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject'), - ), - migrations.AddField( - model_name='mailbatch', - name='study', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study', verbose_name='Study'), - ), - migrations.AddField( - model_name='attributeset', - name='subject', - field=models.OneToOneField(editable=False, on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject'), - ), - migrations.AddField( - model_name='attributedescriptiontranslation', - name='master', - field=parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='recruitment.AttributeDescription'), - ), - migrations.AddField( - model_name='attributedescription', - name='category', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='recruitment.AttributeCategory'), - ), - migrations.AddField( - model_name='attributechoicetranslation', - name='master', - field=parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='recruitment.AttributeChoice'), - ), - migrations.AddField( - model_name='attributechoice', - name='description', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='recruitment.AttributeDescription'), - ), - migrations.AddField( - model_name='attributecategorytranslation', - name='master', - field=parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='recruitment.AttributeCategory'), - ), - migrations.AlterUniqueTogether( - name='participationrequest', - unique_together={('study', 'subject')}, - ), - migrations.AlterUniqueTogether( - name='attributedescriptiontranslation', - unique_together={('language_code', 'master')}, - ), - migrations.AlterUniqueTogether( - name='attributechoicetranslation', - unique_together={('language_code', 'master')}, - ), - migrations.AlterUniqueTogether( - name='attributecategorytranslation', - unique_together={('language_code', 'master')}, - ), - ] diff --git a/castellum/recruitment/migrations/0003_fullowup.py b/castellum/recruitment/migrations/0003_fullowup.py deleted file mode 100644 index d01ecf682..000000000 --- a/castellum/recruitment/migrations/0003_fullowup.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 2.2.7 on 2019-11-19 10:44 - -import castellum.utils.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('recruitment', '0002_auto_20191116_1743'), - ] - - operations = [ - migrations.RenameField( - model_name='participationrequestrevision', - old_name='appointment', - new_name='followup', - ), - migrations.RenameField( - model_name='participationrequest', - old_name='appointment', - new_name='followup', - ), - migrations.AlterField( - model_name='participationrequest', - name='followup', - field=castellum.utils.fields.DateTimeField(blank=True, null=True, verbose_name='Follow-up'), - ), - ] diff --git a/castellum/recruitment/migrations/0004_attributeset_study_type_disinterest.py b/castellum/recruitment/migrations/0004_attributeset_study_type_disinterest.py deleted file mode 100644 index 7206874fb..000000000 --- a/castellum/recruitment/migrations/0004_attributeset_study_type_disinterest.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.7 on 2019-11-20 13:09 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0001_initial'), - ('recruitment', '0003_fullowup'), - ] - - operations = [ - migrations.AddField( - model_name='attributeset', - name='study_type_disinterest', - field=models.ManyToManyField(blank=True, related_name='_attributeset_study_type_disinterest_+', to='studies.StudyType', verbose_name='Does not want to participate in the following study types:'), - ), - ] diff --git a/castellum/recruitment/migrations/0005_split_followup.py b/castellum/recruitment/migrations/0005_split_followup.py deleted file mode 100644 index 3a79daa73..000000000 --- a/castellum/recruitment/migrations/0005_split_followup.py +++ /dev/null @@ -1,52 +0,0 @@ -import castellum.utils.fields -from django.db import migrations, models - - -def split_followup(model): - for obj in model.objects.filter(followup__isnull=False): - obj.followup_date = obj.followup.date() - obj.followup_time = obj.followup.time() - obj.save() - - -def migrate_values(apps, schema_editor): - split_followup(apps.get_model('recruitment', 'ParticipationRequest')) - split_followup(apps.get_model('recruitment', 'ParticipationRequestRevision')) - - -class Migration(migrations.Migration): - - dependencies = [ - ('recruitment', '0004_attributeset_study_type_disinterest'), - ] - - operations = [ - migrations.AddField( - model_name='participationrequest', - name='followup_date', - field=castellum.utils.fields.DateField(blank=True, null=True, verbose_name='Follow-up date'), - ), - migrations.AddField( - model_name='participationrequest', - name='followup_time', - field=models.TimeField(blank=True, null=True, verbose_name='Follow-up time'), - ), - migrations.AddField( - model_name='participationrequestrevision', - name='followup_date', - field=castellum.utils.fields.DateField(blank=True, null=True), - ), - migrations.AddField( - model_name='participationrequestrevision', - name='followup_time', - field=models.TimeField(blank=True, null=True), - ), - migrations.RemoveField( - model_name='participationrequest', - name='followup', - ), - migrations.RemoveField( - model_name='participationrequestrevision', - name='followup', - ), - ] diff --git a/castellum/recruitment/migrations/0006_subjectfilter_value_json.py b/castellum/recruitment/migrations/0006_subjectfilter_value_json.py deleted file mode 100644 index edcc2fba6..000000000 --- a/castellum/recruitment/migrations/0006_subjectfilter_value_json.py +++ /dev/null @@ -1,33 +0,0 @@ -from django.contrib.postgres.fields import JSONField -from django.db import migrations - - -def copy_value(apps, schema_editor): - SubjectFilter = apps.get_model('recruitment', 'SubjectFilter') - for f in SubjectFilter.objects.all(): - f.value = f.value_old - f.save() - - -class Migration(migrations.Migration): - dependencies = [ - ('recruitment', '0005_split_followup'), - ] - - operations = [ - migrations.RenameField( - model_name='subjectfilter', - old_name='value', - new_name='value_old', - ), - migrations.AddField( - model_name='subjectfilter', - name='value', - field=JSONField(default={}), - preserve_default=False, - ), - migrations.RemoveField( - model_name='subjectfilter', - name='value_old', - ), - ] diff --git a/castellum/recruitment/migrations/0007_perm_search_execution.py b/castellum/recruitment/migrations/0007_perm_search_execution.py deleted file mode 100644 index d1e3cd66d..000000000 --- a/castellum/recruitment/migrations/0007_perm_search_execution.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.2 on 2020-02-04 09:15 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('recruitment', '0006_subjectfilter_value_json'), - ] - - operations = [ - migrations.AlterModelOptions( - name='participationrequest', - options={'permissions': (('view_participation_pseudonyms', 'Can view participation pseudonyms'), ('search_execution', 'Can search in execution')), 'verbose_name': 'Participation request', 'verbose_name_plural': 'Participation requests'}, - ), - ] diff --git a/castellum/studies/migrations/0001_initial.py b/castellum/studies/migrations/0001_initial.py deleted file mode 100644 index 822d09e6b..000000000 --- a/castellum/studies/migrations/0001_initial.py +++ /dev/null @@ -1,117 +0,0 @@ -# Generated by Django 2.2.6 on 2019-11-16 16:43 - -import castellum.utils.fields -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import parler.fields -import parler.models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('auth', '0011_update_proxy_permissions'), - ] - - operations = [ - migrations.CreateModel( - name='Study', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=254, verbose_name='Name')), - ('contact_person', models.CharField(max_length=254, verbose_name='Responsible contact person')), - ('principal_investigator', models.CharField(max_length=254, verbose_name='Principal Investigator')), - ('affiliated_scientists', models.CharField(blank=True, max_length=254, verbose_name='Affiliated Scientists')), - ('affiliated_research_assistants', models.CharField(blank=True, max_length=254, verbose_name='Affiliated Research Assistants')), - ('description', models.TextField(blank=True, verbose_name='Description')), - ('keywords', models.CharField(blank=True, max_length=254, verbose_name='Keywords')), - ('previous_status', models.SmallIntegerField(choices=[(0, 'Edit'), (1, 'Execution'), (2, 'Finished')], default=0, verbose_name='Previous status')), - ('status', models.SmallIntegerField(choices=[(0, 'Edit'), (1, 'Execution'), (2, 'Finished')], default=0, verbose_name='Status')), - ('data_sensitivity', models.BooleanField(default=False, verbose_name='Contains sensitive data')), - ('min_subject_count', models.PositiveIntegerField(blank=True, verbose_name='Required number of subjects')), - ('expense_allowance', models.PositiveIntegerField(blank=True, null=True, verbose_name='Expense allowance')), - ('sessions_start', castellum.utils.fields.DateField(blank=True, null=True, verbose_name='Start of test sessions')), - ('sessions_end', castellum.utils.fields.DateField(blank=True, null=True, verbose_name='End of test sessions')), - ('exclusion_criteria', models.TextField(blank=True, verbose_name='Inclusion/exclusion criteria')), - ('recruitment_text', models.TextField(blank=True, verbose_name='Recruitment text')), - ('domain', models.CharField(default=None, editable=False, max_length=64, unique=True)), - ('advanced_filtering', models.BooleanField(default=False, help_text='By default you can create only one filtergroup in which all the filters are joined by AND operator. Advanced filtering allows you to create multiple filtergroups which are joined by OR operator.', verbose_name='Advanced filtering')), - ('custom_filter', models.CharField(blank=True, max_length=254, verbose_name='Custom filter')), - ('is_exclusive', models.BooleanField(default=False, help_text='When set, this ensures that potential subjects for this study will not be recruited in other studies. Please note that this may hinder other researchers in finding enough participants.', verbose_name='Exclusive subjects')), - ('complete_matches_only', models.BooleanField(default=False, help_text='By default, filters may include subjects with incomplete attribute sets. This feature is supposed to improve the quality of the database by asking recruiters to fill missing values on the go. Only allowing complete filter matches can speed up individual recruitments but may deteriorate the quality of the database as a whole. Furthermore, this reduces the number of potential subjects.', verbose_name='Complete filter matches only')), - ('consent', castellum.utils.fields.RestrictedFileField(blank=True, upload_to='studies/consent/', verbose_name='Consent')), - ('mail_subject', models.CharField(blank=True, max_length=254, verbose_name='E-mail subject')), - ('mail_body', models.TextField(blank=True, verbose_name='E-mail body')), - ('mail_reply_address', models.EmailField(blank=True, max_length=128, verbose_name='Reply e-mail-address')), - ('excluded_studies', models.ManyToManyField(blank=True, related_name='_study_excluded_studies_+', to='studies.Study', verbose_name='Excluded studies')), - ], - options={ - 'ordering': ['name'], - 'permissions': [('access_study', 'Can access studies')], - }, - ), - migrations.CreateModel( - name='StudyType', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('exclusion_criteria', models.TextField(blank=True, verbose_name='Inclusion/exclusion criteria')), - ('data_sensitivity', models.BooleanField(default=False, verbose_name='Contains sensitive data')), - ], - options={ - 'abstract': False, - }, - bases=(parler.models.TranslatableModelMixin, models.Model), - ), - migrations.CreateModel( - name='StudySession', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('duration', models.PositiveIntegerField(verbose_name='Duration of a session in minutes')), - ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study')), - ], - ), - migrations.CreateModel( - name='StudyMembership', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('groups', models.ManyToManyField(blank=True, related_name='_studymembership_groups_+', to='auth.Group')), - ('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='studies.Study')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'unique_together': {('study', 'user')}, - }, - ), - migrations.AddField( - model_name='study', - name='members', - field=models.ManyToManyField(through='studies.StudyMembership', to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='study', - name='study_type', - field=models.ManyToManyField(blank=True, to='studies.StudyType', verbose_name='Type of study'), - ), - migrations.CreateModel( - name='StudyTypeTranslation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')), - ('label', models.CharField(max_length=64, verbose_name='Label')), - ('master', parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='studies.StudyType')), - ], - options={ - 'verbose_name': 'study type Translation', - 'db_table': 'studies_studytype_translation', - 'db_tablespace': '', - 'managed': True, - 'default_permissions': (), - 'unique_together': {('language_code', 'master')}, - }, - bases=(parler.models.TranslatedFieldsModelMixin, models.Model), - ), - ] diff --git a/castellum/studies/migrations/0002_studytype_export_key.py b/castellum/studies/migrations/0002_studytype_export_key.py deleted file mode 100644 index 0d02a2f51..000000000 --- a/castellum/studies/migrations/0002_studytype_export_key.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.6 on 2019-11-19 11:09 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='studytype', - name='export_key', - field=models.CharField(blank=True, choices=[('Online', 'Online'), ('Behavioral lab', 'Behavioral lab'), ('MRI', 'MRI'), ('Simulation', 'Simulation'), ('EEG', 'EEG'), ('3rd party', '3rd party')], max_length=32, verbose_name='Export key'), - ), - ] diff --git a/castellum/studies/migrations/0003_auto_20200106_1502.py b/castellum/studies/migrations/0003_auto_20200106_1502.py deleted file mode 100644 index 0836d1027..000000000 --- a/castellum/studies/migrations/0003_auto_20200106_1502.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.8 on 2020-01-06 14:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0002_studytype_export_key'), - ] - - operations = [ - migrations.AlterField( - model_name='study', - name='mail_body', - field=models.TextField(blank=True, help_text='Any "{firstname}" and "{lastname}"-tags included in the e-mail-body will automatically be replaced with the first and last name of the subject.', verbose_name='E-mail body'), - ), - ] diff --git a/castellum/studies/migrations/0004_study_exclusion_critera_verbose_name.py b/castellum/studies/migrations/0004_study_exclusion_critera_verbose_name.py deleted file mode 100644 index ae0e25c70..000000000 --- a/castellum/studies/migrations/0004_study_exclusion_critera_verbose_name.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.0.2 on 2020-01-29 13:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0003_auto_20200106_1502'), - ] - - operations = [ - migrations.AlterField( - model_name='studytype', - name='exclusion_criteria', - field=models.TextField(blank=True, verbose_name='Additional subject characteristics that should be verified during recruitment'), - ), - migrations.AlterField( - model_name='study', - name='exclusion_criteria', - field=models.TextField(blank=True, verbose_name='Additional subject characteristics that should be verified during recruitment'), - ), - ] diff --git a/castellum/studies/migrations/0005_study_to_be_deleted_notified.py b/castellum/studies/migrations/0005_study_to_be_deleted_notified.py deleted file mode 100644 index 163a10423..000000000 --- a/castellum/studies/migrations/0005_study_to_be_deleted_notified.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.2 on 2020-02-18 17:05 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0004_study_exclusion_critera_verbose_name'), - ] - - operations = [ - migrations.AddField( - model_name='study', - name='to_be_deleted_notified', - field=models.BooleanField(default=False), - ), - ] diff --git a/castellum/studies/migrations/0006_study_min_subject_count_default.py b/castellum/studies/migrations/0006_study_min_subject_count_default.py deleted file mode 100644 index 1b5d40877..000000000 --- a/castellum/studies/migrations/0006_study_min_subject_count_default.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.4 on 2020-04-01 14:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0005_study_to_be_deleted_notified'), - ] - - operations = [ - migrations.AlterField( - model_name='study', - name='min_subject_count', - field=models.PositiveIntegerField(default=0, verbose_name='Required number of subjects'), - ), - ] diff --git a/castellum/studies/migrations/0007_studysession_name_resource.py b/castellum/studies/migrations/0007_studysession_name_resource.py deleted file mode 100644 index 5bd43795f..000000000 --- a/castellum/studies/migrations/0007_studysession_name_resource.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.0.4 on 2020-03-18 17:44 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0006_study_min_subject_count_default'), - ] - - operations = [ - migrations.CreateModel( - name='Resource', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=128, verbose_name='Name')), - ], - ), - migrations.AddField( - model_name='studysession', - name='name', - field=models.CharField(default='session', max_length=128, verbose_name='Name'), - preserve_default=False, - ), - migrations.AddField( - model_name='studysession', - name='resource', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='studies.Resource', verbose_name='Resource'), - ), - ] diff --git a/castellum/studies/migrations/0008_study_type_rm_3rd_party.py b/castellum/studies/migrations/0008_study_type_rm_3rd_party.py deleted file mode 100644 index ab52d4f00..000000000 --- a/castellum/studies/migrations/0008_study_type_rm_3rd_party.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.5 on 2020-04-29 15:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0007_studysession_name_resource'), - ] - - operations = [ - migrations.AlterField( - model_name='studytype', - name='export_key', - field=models.CharField(blank=True, choices=[('Online', 'Online'), ('Behavioral lab', 'Behavioral lab'), ('MRI', 'MRI'), ('Simulation', 'Simulation'), ('EEG', 'EEG')], max_length=32, verbose_name='Export key'), - ), - ] diff --git a/castellum/studies/migrations/0009_study_session_instructions.py b/castellum/studies/migrations/0009_study_session_instructions.py deleted file mode 100644 index 988992618..000000000 --- a/castellum/studies/migrations/0009_study_session_instructions.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.5 on 2020-05-05 09:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0008_study_type_rm_3rd_party'), - ] - - operations = [ - migrations.AddField( - model_name='study', - name='session_instructions', - field=models.TextField(blank=True, help_text='Please describe any requirements for carrying out the sessions listed below. For example, specify time intervals between sessions that need to be considered for booking appointments.', verbose_name='Session instructions'), - ), - ] diff --git a/castellum/studies/migrations/0010_studysession_type.py b/castellum/studies/migrations/0010_studysession_type.py deleted file mode 100644 index 68ed9e80a..000000000 --- a/castellum/studies/migrations/0010_studysession_type.py +++ /dev/null @@ -1,33 +0,0 @@ -from django.db import migrations, models - - -def migrate_data(apps, schema_editor): - Study = apps.get_model('studies', 'Study') - StudySession = apps.get_model('studies', 'StudySession') - - for study in Study.objects.all(): - if not study.study_type.exists(): - continue - session = study.studysession_set.first() - if not session: - session = study.studysession_set.create(name='session', duration=0) - session.type.set(study.study_type.all()) - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0009_study_session_instructions') - ] - - operations = [ - migrations.AddField( - model_name='studysession', - name='type', - field=models.ManyToManyField(blank=True, to='studies.StudyType', verbose_name='Type'), - ), - migrations.RemoveField( - model_name='study', - name='study_type', - ), - ] diff --git a/castellum/studies/migrations/0011_rm_study_expense_allowance.py b/castellum/studies/migrations/0011_rm_study_expense_allowance.py deleted file mode 100644 index bfa4691a0..000000000 --- a/castellum/studies/migrations/0011_rm_study_expense_allowance.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.0.5 on 2020-05-06 14:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0010_studysession_type'), - ] - - operations = [ - migrations.RemoveField( - model_name='study', - name='expense_allowance', - ), - migrations.AlterField( - model_name='study', - name='recruitment_text', - field=models.TextField(blank=True, help_text='This text will be used during recruitment dialogue. Thus, please describe the study from the perspective of recruiters and potential participants: What is it about? How long will it take? Are there any potential benefits or risks for participants? If applicable, also present the amount of expense allowance and related requirements.', verbose_name='Recruitment text'), - ), - ] diff --git a/castellum/studies/migrations/0012_study_geo_filter.py b/castellum/studies/migrations/0012_study_geo_filter.py deleted file mode 100644 index a995d7aa1..000000000 --- a/castellum/studies/migrations/0012_study_geo_filter.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.0.6 on 2020-06-15 10:18 - -import castellum.utils.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0011_rm_study_expense_allowance'), - ] - - operations = [ - migrations.AddField( - model_name='study', - name='geo_filter', - field=castellum.utils.fields.RestrictedFileField(blank=True, help_text='A GeoJSON file that contains only a single (multi)polygon. Only subjects who live inside this polygon will be considered for this study.', upload_to='studies/geofilters/', verbose_name='Geo filter file'), - ), - ] diff --git a/castellum/studies/migrations/0013_geojson_validator.py b/castellum/studies/migrations/0013_geojson_validator.py deleted file mode 100644 index c8e2605dc..000000000 --- a/castellum/studies/migrations/0013_geojson_validator.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.0.6 on 2020-06-22 13:41 - -import castellum.utils.fields -import castellum.utils.forms -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('studies', '0012_study_geo_filter'), - ] - - operations = [ - migrations.AlterField( - model_name='study', - name='geo_filter', - field=castellum.utils.fields.RestrictedFileField(blank=True, help_text='A GeoJSON file that contains only a single (multi)polygon. Only subjects who live inside this polygon will be considered for this study.', upload_to='studies/geofilters/', validators=[castellum.utils.forms.JsonFileValidator({'$defs': {'Feature': {'properties': {'geometry': {'oneOf': [{'$ref': '#/$defs/Polygon'}, {'$ref': '#/$defs/MultiPolygon'}]}, 'properties': {'oneOf': [{'type': 'null'}, {'type': 'object'}]}, 'type': {'enum': ['Feature'], 'type': 'string'}}, 'required': ['type', 'properties', 'geometry'], 'type': 'object'}, 'MultiPolygon': {'properties': {'coordinates': {'items': {'$ref': '#/$defs/MultiPolygon'}, 'type': 'array'}, 'type': {'enum': ['MultiPolygon'], 'type': 'string'}}, 'required': ['type', 'coordinates'], 'type': 'object'}, 'Polygon': {'properties': {'coordinates': {'$ref': '#/$defs/PolygonCoordinates'}, 'type': {'enum': ['Polygon'], 'type': 'string'}}, 'required': ['type', 'coordinates'], 'type': 'object'}, 'PolygonCoordinates': {'items': {'items': {'items': {'type': 'number'}, 'minItems': 2, 'type': 'array'}, 'minItems': 4, 'type': 'array'}, 'type': 'array'}}, '$schema': 'http://json-schema.org/draft-07/schema#'}, '#/$defs/Feature')], verbose_name='Geo filter file'), - ), - ] diff --git a/castellum/subjects/migrations/0001_initial.py b/castellum/subjects/migrations/0001_initial.py deleted file mode 100644 index 355384ffe..000000000 --- a/castellum/subjects/migrations/0001_initial.py +++ /dev/null @@ -1,104 +0,0 @@ -# Generated by Django 2.2.6 on 2019-11-16 16:43 - -import castellum.utils.fields -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Consent', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')), - ('info', models.CharField(max_length=128, verbose_name='Info')), - ('file', castellum.utils.fields.RestrictedFileField(upload_to='consent/', verbose_name='File')), - ], - options={ - 'get_latest_by': 'created_at', - }, - ), - migrations.CreateModel( - name='Subject', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateField(auto_now_add=True, verbose_name='created at')), - ('updated_at', models.DateField(auto_now=True, verbose_name='updated at')), - ('privacy_level', models.PositiveIntegerField(choices=[(0, '0 (regular)'), (1, '1 (increased)'), (2, '2 (high)')], default=0, verbose_name='Privacy level')), - ('no_recruitment', models.BooleanField(default=False, verbose_name='Do not contact for recruitment')), - ('to_be_deleted', models.DateTimeField(blank=True, null=True, verbose_name='To be deleted')), - ('note_hard_of_hearing', models.BooleanField(default=False, verbose_name='Hard of hearing')), - ('note_difficult_to_understand', models.BooleanField(default=False, verbose_name='Difficult to understand')), - ('note_abusive_language', models.BooleanField(default=False, verbose_name='Abusive language')), - ('not_available_until', castellum.utils.fields.DateTimeField(blank=True, null=True, verbose_name='not available until')), - ], - options={ - 'verbose_name': 'Subject', - }, - ), - migrations.CreateModel( - name='TimeSlot', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('hour', models.PositiveSmallIntegerField(verbose_name='hour')), - ], - options={ - 'ordering': ['hour'], - }, - ), - migrations.CreateModel( - name='SubjectNote', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('content', models.CharField(blank=True, max_length=128, verbose_name='Content')), - ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject')), - ], - ), - migrations.AddField( - model_name='subject', - name='availability_friday', - field=models.ManyToManyField(blank=True, related_name='_subject_availability_friday_+', to='subjects.TimeSlot', verbose_name='Friday'), - ), - migrations.AddField( - model_name='subject', - name='availability_monday', - field=models.ManyToManyField(blank=True, related_name='_subject_availability_monday_+', to='subjects.TimeSlot', verbose_name='Monday'), - ), - migrations.AddField( - model_name='subject', - name='availability_thursday', - field=models.ManyToManyField(blank=True, related_name='_subject_availability_thursday_+', to='subjects.TimeSlot', verbose_name='Thursday'), - ), - migrations.AddField( - model_name='subject', - name='availability_tuesday', - field=models.ManyToManyField(blank=True, related_name='_subject_availability_tuesday_+', to='subjects.TimeSlot', verbose_name='Tuesday'), - ), - migrations.AddField( - model_name='subject', - name='availability_wednesday', - field=models.ManyToManyField(blank=True, related_name='_subject_availability_wednesday_+', to='subjects.TimeSlot', verbose_name='Wednesday'), - ), - migrations.CreateModel( - name='ConsentConfirmation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')), - ('type', models.CharField(choices=[('online', 'Online form'), ('paper', 'Pen & Paper'), ('phone', 'Telephone')], max_length=64, verbose_name='Type')), - ('status', models.CharField(choices=[('waiting', 'Waiting for confirmation'), ('confirmed', 'Confirmed')], max_length=64, verbose_name='Status')), - ('revision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.Consent')), - ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject')), - ], - options={ - 'verbose_name': 'Consent confirmation', - 'get_latest_by': 'revision__created_at', - }, - ), - ] diff --git a/castellum/subjects/migrations/0002_subject_to_be_deleted_notified.py b/castellum/subjects/migrations/0002_subject_to_be_deleted_notified.py deleted file mode 100644 index db99b5b07..000000000 --- a/castellum/subjects/migrations/0002_subject_to_be_deleted_notified.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.2 on 2020-02-18 14:56 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='subject', - name='to_be_deleted_notified', - field=models.BooleanField(default=False), - ), - ] diff --git a/castellum/subjects/migrations/0003_subject_to_be_deleted_help_texts.py b/castellum/subjects/migrations/0003_subject_to_be_deleted_help_texts.py deleted file mode 100644 index c8e0e8a3f..000000000 --- a/castellum/subjects/migrations/0003_subject_to_be_deleted_help_texts.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.0.3 on 2020-02-24 12:48 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0002_subject_to_be_deleted_notified'), - ] - - operations = [ - migrations.AlterField( - model_name='subject', - name='no_recruitment', - field=models.BooleanField(default=False, help_text='This subject will not be taken into account for future recruitment, but the existing data is not deleted. This option should be used when a subject withdraws (GDPR) consent for recruitment.', verbose_name='Do not contact for recruitment'), - ), - migrations.AlterField( - model_name='subject', - name='to_be_deleted', - field=models.DateTimeField(blank=True, help_text='All data about this subject should be deleted or fully anonymized. This includes all data in Castellum and all data collected in studies. This option should be used when a subject requests GDPR deletion.', null=True, verbose_name='To be deleted'), - ), - ] diff --git a/castellum/subjects/migrations/0004_subject_to_be_deleted_date.py b/castellum/subjects/migrations/0004_subject_to_be_deleted_date.py deleted file mode 100644 index 6f0b886c7..000000000 --- a/castellum/subjects/migrations/0004_subject_to_be_deleted_date.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2020-02-26 15:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0003_subject_to_be_deleted_help_texts'), - ] - - operations = [ - migrations.AlterField( - model_name='subject', - name='to_be_deleted', - field=models.DateField(blank=True, help_text='All data about this subject should be deleted or fully anonymized. This includes all data in Castellum and all data collected in studies. This option should be used when a subject requests GDPR deletion.', null=True, verbose_name='To be deleted'), - ), - ] diff --git a/castellum/subjects/migrations/0005_subject_export_requested.py b/castellum/subjects/migrations/0005_subject_export_requested.py deleted file mode 100644 index cca2643c7..000000000 --- a/castellum/subjects/migrations/0005_subject_export_requested.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2020-02-26 15:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0004_subject_to_be_deleted_date'), - ] - - operations = [ - migrations.AddField( - model_name='subject', - name='export_requested', - field=models.DateField(blank=True, help_text='The subject wants to receive an export of all data we have stored about them. This includes all data in Castellum and all data collected in studies. This option should be used when a subject requests GDPR export.', null=True, verbose_name='Export requested'), - ), - ] diff --git a/castellum/subjects/migrations/0006_exportanswer.py b/castellum/subjects/migrations/0006_exportanswer.py deleted file mode 100644 index 0f20748e4..000000000 --- a/castellum/subjects/migrations/0006_exportanswer.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.0.3 on 2020-02-26 16:38 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0005_subject_export_requested'), - ] - - operations = [ - migrations.CreateModel( - name='ExportAnswer', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateField(auto_now_add=True, verbose_name='Created at')), - ('created_by', models.CharField(max_length=150, verbose_name='Created by')), - ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject')), - ], - options={ - 'verbose_name': 'Export answer', - }, - ), - ] diff --git a/castellum/subjects/migrations/0007_consent_is_current.py b/castellum/subjects/migrations/0007_consent_is_current.py deleted file mode 100644 index 14f804452..000000000 --- a/castellum/subjects/migrations/0007_consent_is_current.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2020-03-04 09:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0006_exportanswer'), - ] - - operations = [ - migrations.AddField( - model_name='consent', - name='is_current', - field=models.BooleanField(default=True, verbose_name='Is current'), - ), - ] diff --git a/castellum/subjects/migrations/0008_rename_consent.py b/castellum/subjects/migrations/0008_rename_consent.py deleted file mode 100644 index a3dfc2c3a..000000000 --- a/castellum/subjects/migrations/0008_rename_consent.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.0.3 on 2020-03-10 10:52 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0007_consent_is_current'), - ] - - operations = [ - migrations.RenameModel( - old_name='Consent', - new_name='ConsentDocument', - ), - migrations.AlterModelOptions( - name='consentconfirmation', - options={'get_latest_by': 'document__created_at', 'verbose_name': 'Consent confirmation'}, - ), - migrations.RenameField( - model_name='consentconfirmation', - old_name='revision', - new_name='document', - ), - migrations.RenameModel( - old_name='ConsentConfirmation', - new_name='Consent', - ), - migrations.AlterModelOptions( - name='consent', - options={'get_latest_by': 'document__created_at', 'verbose_name': 'Consent'}, - ), - ] diff --git a/castellum/subjects/migrations/0009_subject_source.py b/castellum/subjects/migrations/0009_subject_source.py deleted file mode 100644 index e49339b22..000000000 --- a/castellum/subjects/migrations/0009_subject_source.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2020-03-10 11:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0008_rename_consent'), - ] - - operations = [ - migrations.AddField( - model_name='subject', - name='source', - field=models.CharField(blank=True, max_length=128, verbose_name='Data source'), - ), - ] diff --git a/castellum/subjects/migrations/0010_remove_consent_type.py b/castellum/subjects/migrations/0010_remove_consent_type.py deleted file mode 100644 index 66fcc3b1e..000000000 --- a/castellum/subjects/migrations/0010_remove_consent_type.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.4 on 2020-03-30 14:38 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0009_subject_source'), - ] - - operations = [ - migrations.RemoveField( - model_name='consent', - name='type', - ), - ] diff --git a/castellum/subjects/migrations/0011_remove_consentdocument_info.py b/castellum/subjects/migrations/0011_remove_consentdocument_info.py deleted file mode 100644 index d1f93b072..000000000 --- a/castellum/subjects/migrations/0011_remove_consentdocument_info.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.4 on 2020-04-01 15:32 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0010_remove_consent_type'), - ] - - operations = [ - migrations.RemoveField( - model_name='consentdocument', - name='info', - ), - ] diff --git a/castellum/subjects/migrations/0012_consentdocument_file_optional.py b/castellum/subjects/migrations/0012_consentdocument_file_optional.py deleted file mode 100644 index 7a536d64c..000000000 --- a/castellum/subjects/migrations/0012_consentdocument_file_optional.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.0.4 on 2020-04-08 13:10 - -import castellum.utils.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0011_remove_consentdocument_info'), - ] - - operations = [ - migrations.AlterField( - model_name='consentdocument', - name='file', - field=castellum.utils.fields.RestrictedFileField(blank=True, upload_to='consent/', verbose_name='File'), - ), - ] diff --git a/castellum/subjects/migrations/0013_rename_consentdocument_is_valid.py b/castellum/subjects/migrations/0013_rename_consentdocument_is_valid.py deleted file mode 100644 index f40234d4a..000000000 --- a/castellum/subjects/migrations/0013_rename_consentdocument_is_valid.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.0.4 on 2020-04-08 13:10 - -import castellum.utils.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0012_consentdocument_file_optional'), - ] - - operations = [ - migrations.RenameField( - model_name='consentdocument', - old_name='is_current', - new_name='is_valid', - ), - migrations.AlterField( - model_name='consentdocument', - name='is_valid', - field=models.BooleanField(default=True, verbose_name='Is valid'), - ), - ] diff --git a/castellum/subjects/migrations/0014_remove_subject_no_recruitment.py b/castellum/subjects/migrations/0014_remove_subject_no_recruitment.py deleted file mode 100644 index 3491508a3..000000000 --- a/castellum/subjects/migrations/0014_remove_subject_no_recruitment.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.4 on 2020-04-15 12:56 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0013_rename_consentdocument_is_valid'), - ] - - operations = [ - migrations.RemoveField( - model_name='subject', - name='no_recruitment', - ), - ] diff --git a/castellum/subjects/migrations/0015_subject_consent_onetoonefield.py b/castellum/subjects/migrations/0015_subject_consent_onetoonefield.py deleted file mode 100644 index 84f729ba5..000000000 --- a/castellum/subjects/migrations/0015_subject_consent_onetoonefield.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.0.4 on 2020-04-15 13:44 - -from django.db import migrations, models -import django.db.models.deletion - - -def delete_surplus_consents(apps, schema_editor): - Consent = apps.get_model('subjects', 'Consent') - Subject = apps.get_model('subjects', 'Subject') - - for subject in Subject.objects.all(): - try: - consent = subject.consent_set.latest() - subject.consent_set.exclude(pk=consent.pk).delete() - except Consent.DoesNotExist: - pass - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0014_remove_subject_no_recruitment'), - ] - - operations = [ - migrations.AlterField( - model_name='consent', - name='subject', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='subjects.Subject'), - ), - ] diff --git a/castellum/subjects/migrations/0016_consentdocument_is_deprecated.py b/castellum/subjects/migrations/0016_consentdocument_is_deprecated.py deleted file mode 100644 index 95e17c881..000000000 --- a/castellum/subjects/migrations/0016_consentdocument_is_deprecated.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.4 on 2020-04-21 09:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('subjects', '0015_subject_consent_onetoonefield'), - ] - - operations = [ - migrations.AddField( - model_name='consentdocument', - name='is_deprecated', - field=models.BooleanField(default=False, verbose_name='Is deprecated'), - ), - ] -- GitLab From a0b30c85709d66ada9ba605329068446cb3ab56d Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 1 Sep 2020 11:39:27 +0200 Subject: [PATCH 4/5] rm replaces --- .../castellum_auth/migrations/0001_squashed_0002_initial.py | 2 -- castellum/contacts/migrations/0001_squashed_0004_initial.py | 2 -- castellum/pseudonyms/migrations/0001_squashed_0002_initial.py | 2 -- castellum/recruitment/migrations/0001_squashed_0007_initial.py | 2 -- castellum/studies/migrations/0001_squashed_0013_initial.py | 2 -- castellum/subjects/migrations/0001_squashed_0016_initial.py | 2 -- 6 files changed, 12 deletions(-) diff --git a/castellum/castellum_auth/migrations/0001_squashed_0002_initial.py b/castellum/castellum_auth/migrations/0001_squashed_0002_initial.py index bae9bd548..c7b4e4058 100644 --- a/castellum/castellum_auth/migrations/0001_squashed_0002_initial.py +++ b/castellum/castellum_auth/migrations/0001_squashed_0002_initial.py @@ -11,8 +11,6 @@ import django.utils.timezone class Migration(migrations.Migration): - replaces = [('castellum_auth', '0001_initial'), ('castellum_auth', '0002_user_token')] - initial = True dependencies = [ diff --git a/castellum/contacts/migrations/0001_squashed_0004_initial.py b/castellum/contacts/migrations/0001_squashed_0004_initial.py index 6cf25b7a6..da409c45e 100644 --- a/castellum/contacts/migrations/0001_squashed_0004_initial.py +++ b/castellum/contacts/migrations/0001_squashed_0004_initial.py @@ -7,8 +7,6 @@ import django.db.models.deletion class Migration(migrations.Migration): - replaces = [('contacts', '0001_initial'), ('contacts', '0002_contact_subject_id'), ('contacts', '0003_subject_id_positive'), ('contacts', '0004_refactor_contact_address')] - initial = True dependencies = [ diff --git a/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py b/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py index 71d5ad509..7e70dc41f 100644 --- a/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py +++ b/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py @@ -7,8 +7,6 @@ import django.db.models.deletion class Migration(migrations.Migration): - replaces = [('pseudonyms', '0001_initial'), ('pseudonyms', '0002_pseudonym_unique_subject_domain')] - initial = True dependencies = [ diff --git a/castellum/recruitment/migrations/0001_squashed_0007_initial.py b/castellum/recruitment/migrations/0001_squashed_0007_initial.py index 30845a4c0..39e97fba4 100644 --- a/castellum/recruitment/migrations/0001_squashed_0007_initial.py +++ b/castellum/recruitment/migrations/0001_squashed_0007_initial.py @@ -13,8 +13,6 @@ import parler.models class Migration(migrations.Migration): - replaces = [('recruitment', '0001_initial'), ('recruitment', '0002_auto_20191116_1743'), ('recruitment', '0003_fullowup'), ('recruitment', '0004_attributeset_study_type_disinterest'), ('recruitment', '0005_split_followup'), ('recruitment', '0006_subjectfilter_value_json'), ('recruitment', '0007_perm_search_execution')] - initial = True dependencies = [ diff --git a/castellum/studies/migrations/0001_squashed_0013_initial.py b/castellum/studies/migrations/0001_squashed_0013_initial.py index ee5dc8988..b1e7d7768 100644 --- a/castellum/studies/migrations/0001_squashed_0013_initial.py +++ b/castellum/studies/migrations/0001_squashed_0013_initial.py @@ -11,8 +11,6 @@ import parler.models class Migration(migrations.Migration): - replaces = [('studies', '0001_initial'), ('studies', '0002_studytype_export_key'), ('studies', '0003_auto_20200106_1502'), ('studies', '0004_study_exclusion_critera_verbose_name'), ('studies', '0005_study_to_be_deleted_notified'), ('studies', '0006_study_min_subject_count_default'), ('studies', '0007_studysession_name_resource'), ('studies', '0008_study_type_rm_3rd_party'), ('studies', '0009_study_session_instructions'), ('studies', '0010_studysession_type'), ('studies', '0011_rm_study_expense_allowance'), ('studies', '0012_study_geo_filter'), ('studies', '0013_geojson_validator')] - initial = True dependencies = [ diff --git a/castellum/subjects/migrations/0001_squashed_0016_initial.py b/castellum/subjects/migrations/0001_squashed_0016_initial.py index 762bf388e..aa443945c 100644 --- a/castellum/subjects/migrations/0001_squashed_0016_initial.py +++ b/castellum/subjects/migrations/0001_squashed_0016_initial.py @@ -7,8 +7,6 @@ import django.db.models.deletion class Migration(migrations.Migration): - replaces = [('subjects', '0001_initial'), ('subjects', '0002_subject_to_be_deleted_notified'), ('subjects', '0003_subject_to_be_deleted_help_texts'), ('subjects', '0004_subject_to_be_deleted_date'), ('subjects', '0005_subject_export_requested'), ('subjects', '0006_exportanswer'), ('subjects', '0007_consent_is_current'), ('subjects', '0008_rename_consent'), ('subjects', '0009_subject_source'), ('subjects', '0010_remove_consent_type'), ('subjects', '0011_remove_consentdocument_info'), ('subjects', '0012_consentdocument_file_optional'), ('subjects', '0013_rename_consentdocument_is_valid'), ('subjects', '0014_remove_subject_no_recruitment'), ('subjects', '0015_subject_consent_onetoonefield'), ('subjects', '0016_consentdocument_is_deprecated')] - initial = True dependencies = [ -- GitLab From 22898753804ee7c5a1115b9c6b235200fddb2afe Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Tue, 1 Sep 2020 11:46:47 +0200 Subject: [PATCH 5/5] fix dependencies --- castellum/geofilters/migrations/0001_initial.py | 2 +- castellum/pseudonyms/migrations/0001_squashed_0002_initial.py | 3 +-- .../recruitment/migrations/0001_squashed_0007_initial.py | 4 ++-- castellum/recruitment/migrations/0008_appointment.py | 4 ++-- .../migrations/0009_rename_participation_request.py | 4 ++-- castellum/recruitment/migrations/0010_rename_participant.py | 2 +- castellum/studies/migrations/0014_studytypeeventfeed.py | 2 +- castellum/subjects/migrations/0017_refactor_permissions.py | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/castellum/geofilters/migrations/0001_initial.py b/castellum/geofilters/migrations/0001_initial.py index c4094e17c..387428620 100644 --- a/castellum/geofilters/migrations/0001_initial.py +++ b/castellum/geofilters/migrations/0001_initial.py @@ -10,7 +10,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('contacts', '0004_refactor_contact_address'), + ('contacts', '0001_squashed_0004_initial'), ] operations = [ diff --git a/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py b/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py index 7e70dc41f..4f78f779e 100644 --- a/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py +++ b/castellum/pseudonyms/migrations/0001_squashed_0002_initial.py @@ -10,8 +10,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('subjects', '0008_rename_consent'), - ('subjects', '0001_initial'), + ('subjects', '0001_squashed_0016_initial'), ] operations = [ diff --git a/castellum/recruitment/migrations/0001_squashed_0007_initial.py b/castellum/recruitment/migrations/0001_squashed_0007_initial.py index 39e97fba4..8be9e276b 100644 --- a/castellum/recruitment/migrations/0001_squashed_0007_initial.py +++ b/castellum/recruitment/migrations/0001_squashed_0007_initial.py @@ -16,8 +16,8 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('studies', '0001_initial'), - ('subjects', '0001_initial'), + ('studies', '0001_squashed_0013_initial'), + ('subjects', '0001_squashed_0016_initial'), ] operations = [ diff --git a/castellum/recruitment/migrations/0008_appointment.py b/castellum/recruitment/migrations/0008_appointment.py index 45b5bc6c7..527d6d5ec 100644 --- a/castellum/recruitment/migrations/0008_appointment.py +++ b/castellum/recruitment/migrations/0008_appointment.py @@ -8,8 +8,8 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('studies', '0007_studysession_name_resource'), - ('recruitment', '0007_perm_search_execution'), + ('studies', '0001_squashed_0013_initial'), + ('recruitment', '0001_squashed_0007_initial'), ] operations = [ diff --git a/castellum/recruitment/migrations/0009_rename_participation_request.py b/castellum/recruitment/migrations/0009_rename_participation_request.py index c227fb600..6c9ebfffc 100644 --- a/castellum/recruitment/migrations/0009_rename_participation_request.py +++ b/castellum/recruitment/migrations/0009_rename_participation_request.py @@ -8,8 +8,8 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('studies', '0013_geojson_validator'), - ('subjects', '0016_consentdocument_is_deprecated'), + ('studies', '0001_squashed_0013_initial'), + ('subjects', '0001_squashed_0016_initial'), ('recruitment', '0008_appointment'), ] diff --git a/castellum/recruitment/migrations/0010_rename_participant.py b/castellum/recruitment/migrations/0010_rename_participant.py index 513f68b91..e9603bc7a 100644 --- a/castellum/recruitment/migrations/0010_rename_participant.py +++ b/castellum/recruitment/migrations/0010_rename_participant.py @@ -7,7 +7,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('studies', '0013_geojson_validator'), + ('studies', '0001_squashed_0013_initial'), ('recruitment', '0009_rename_participation_request'), ] diff --git a/castellum/studies/migrations/0014_studytypeeventfeed.py b/castellum/studies/migrations/0014_studytypeeventfeed.py index 5cdeaed55..0082f4256 100644 --- a/castellum/studies/migrations/0014_studytypeeventfeed.py +++ b/castellum/studies/migrations/0014_studytypeeventfeed.py @@ -7,7 +7,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('studies', '0013_geojson_validator'), + ('studies', '0001_squashed_0013_initial'), ] operations = [ diff --git a/castellum/subjects/migrations/0017_refactor_permissions.py b/castellum/subjects/migrations/0017_refactor_permissions.py index ce2097dca..daa29863c 100644 --- a/castellum/subjects/migrations/0017_refactor_permissions.py +++ b/castellum/subjects/migrations/0017_refactor_permissions.py @@ -6,7 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ('subjects', '0016_consentdocument_is_deprecated'), + ('subjects', '0001_squashed_0016_initial'), ] operations = [ -- GitLab