This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starts the process of adding support for single-item submissions by introducing a model that can connect a `FacilityListItem` to a `Contributor` without needing a `FacilityList` `FacilityListItem.source` is nullable for now to make the migration backward compatible.
- Loading branch information
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/django/api/migrations/0035_add_source_20190926_2048.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Generated by Django 2.2.3 on 2019-10-01 15:31 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0034_facilitylocation'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Source', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('source_type', models.CharField(choices=[('LIST', 'LIST'), ('SINGLE', 'SINGLE')], help_text='Did the the facility data arrive in a list or a single item', max_length=6)), | ||
('is_active', models.BooleanField(default=True, help_text='True if items from the source should be shown as being associated with the contributor')), | ||
('is_public', models.BooleanField(default=True, help_text='True if the public can see factories from this list are associated with the contributor.')), | ||
('create', models.BooleanField(default=True, help_text='Should a facility or facility match be created from the facility data')), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('updated_at', models.DateTimeField(auto_now=True)), | ||
('contributor', models.ForeignKey(help_text='The contributor who submitted the facility data', null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Contributor')), | ||
('facility_list', models.OneToOneField(help_text='The related list if the type of the source is LIST.', null=True, on_delete=django.db.models.deletion.PROTECT, to='api.FacilityList')), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name='facilitylistitem', | ||
name='source', | ||
field=models.ForeignKey(blank=True, help_text='The source from which this item was created.', null=True, on_delete=django.db.models.deletion.PROTECT, to='api.Source'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters