|
| 1 | +# Generated by Django 4.2.9 on 2024-08-26 02:17 |
| 2 | + |
| 3 | +from django.db import migrations, models |
| 4 | +import django.db.models.deletion |
| 5 | + |
| 6 | + |
| 7 | +class Migration(migrations.Migration): |
| 8 | + |
| 9 | + dependencies = [ |
| 10 | + ("sde_collections", "0057_alter_collection_workflow_status_and_more"), |
| 11 | + ] |
| 12 | + |
| 13 | + operations = [ |
| 14 | + migrations.AddField( |
| 15 | + model_name="candidateurl", |
| 16 | + name="division", |
| 17 | + field=models.IntegerField( |
| 18 | + choices=[ |
| 19 | + (1, "Astrophysics"), |
| 20 | + (2, "Biological and Physical Sciences"), |
| 21 | + (3, "Earth Science"), |
| 22 | + (4, "Heliophysics"), |
| 23 | + (5, "Planetary Science"), |
| 24 | + (6, "General"), |
| 25 | + ], |
| 26 | + null=True, |
| 27 | + ), |
| 28 | + ), |
| 29 | + migrations.AddField( |
| 30 | + model_name="collection", |
| 31 | + name="is_multi_division", |
| 32 | + field=models.BooleanField(default=False, verbose_name="Is Multi-Division?"), |
| 33 | + ), |
| 34 | + migrations.CreateModel( |
| 35 | + name="DivisionPattern", |
| 36 | + fields=[ |
| 37 | + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), |
| 38 | + ( |
| 39 | + "match_pattern", |
| 40 | + models.CharField( |
| 41 | + help_text="This pattern is compared against the URL of all the documents in the collection and matching documents will be returned", |
| 42 | + verbose_name="Pattern", |
| 43 | + ), |
| 44 | + ), |
| 45 | + ( |
| 46 | + "match_pattern_type", |
| 47 | + models.IntegerField(choices=[(1, "Individual URL Pattern"), (2, "Multi-URL Pattern")], default=1), |
| 48 | + ), |
| 49 | + ( |
| 50 | + "division", |
| 51 | + models.IntegerField( |
| 52 | + choices=[ |
| 53 | + (1, "Astrophysics"), |
| 54 | + (2, "Biological and Physical Sciences"), |
| 55 | + (3, "Earth Science"), |
| 56 | + (4, "Heliophysics"), |
| 57 | + (5, "Planetary Science"), |
| 58 | + (6, "General"), |
| 59 | + ] |
| 60 | + ), |
| 61 | + ), |
| 62 | + ( |
| 63 | + "candidate_urls", |
| 64 | + models.ManyToManyField(related_name="%(class)s_urls", to="sde_collections.candidateurl"), |
| 65 | + ), |
| 66 | + ( |
| 67 | + "collection", |
| 68 | + models.ForeignKey( |
| 69 | + on_delete=django.db.models.deletion.CASCADE, |
| 70 | + related_name="%(class)s", |
| 71 | + related_query_name="%(class)ss", |
| 72 | + to="sde_collections.collection", |
| 73 | + ), |
| 74 | + ), |
| 75 | + ], |
| 76 | + options={ |
| 77 | + "verbose_name": "Division Pattern", |
| 78 | + "verbose_name_plural": "Division Patterns", |
| 79 | + "unique_together": {("collection", "match_pattern")}, |
| 80 | + }, |
| 81 | + ), |
| 82 | + ] |
0 commit comments