-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Prepare for the removal of collection_file_item. Make collectio…
…n_file_item_id nullable. Populate collection_file on release, record and compiled_release.
- Loading branch information
1 parent
b5f7bda
commit fb3746e
Showing
14 changed files
with
822 additions
and
166 deletions.
There are no files selected for viewing
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
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
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
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
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
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
91 changes: 91 additions & 0 deletions
91
process/migrations/0043_compiledrelease_collection_file_and_more.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,91 @@ | ||
# Generated by Django 4.2.15 on 2024-11-02 03:30 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("process", "0042_compiledrelease_release_date_release_release_date"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="compiledrelease", | ||
name="collection_file", | ||
field=models.ForeignKey( | ||
db_index=False, null=True, on_delete=django.db.models.deletion.CASCADE, to="process.collectionfile" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="record", | ||
name="collection_file", | ||
field=models.ForeignKey( | ||
db_index=False, null=True, on_delete=django.db.models.deletion.CASCADE, to="process.collectionfile" | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="release", | ||
name="collection_file", | ||
field=models.ForeignKey( | ||
db_index=False, null=True, on_delete=django.db.models.deletion.CASCADE, to="process.collectionfile" | ||
), | ||
), | ||
migrations.AddIndex( | ||
model_name="compiledrelease", | ||
index=models.Index(fields=["collection_file"], name="compiled_release_collection_file_id_idx"), | ||
), | ||
migrations.AddIndex( | ||
model_name="record", | ||
index=models.Index(fields=["collection_file"], name="record_collection_file_id_idx"), | ||
), | ||
migrations.AddIndex( | ||
model_name="release", | ||
index=models.Index(fields=["collection_file"], name="release_collection_file_id_idx"), | ||
), | ||
migrations.AlterField( | ||
model_name="compiledrelease", | ||
name="collection_file_item", | ||
field=models.ForeignKey( | ||
db_index=False, null=True, on_delete=django.db.models.deletion.CASCADE, to="process.collectionfileitem" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="record", | ||
name="collection_file_item", | ||
field=models.ForeignKey( | ||
db_index=False, null=True, on_delete=django.db.models.deletion.CASCADE, to="process.collectionfileitem" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="release", | ||
name="collection_file_item", | ||
field=models.ForeignKey( | ||
db_index=False, null=True, on_delete=django.db.models.deletion.CASCADE, to="process.collectionfileitem" | ||
), | ||
), | ||
migrations.RunSQL( | ||
""" | ||
UPDATE release | ||
SET collection_file_id = collection_file_item.collection_file_id | ||
FROM collection_file_item | ||
WHERE collection_file_item_id = collection_file_item.id | ||
""" | ||
), | ||
migrations.RunSQL( | ||
""" | ||
UPDATE record | ||
SET collection_file_id = collection_file_item.collection_file_id | ||
FROM collection_file_item | ||
WHERE collection_file_item_id = collection_file_item.id | ||
""" | ||
), | ||
migrations.RunSQL( | ||
""" | ||
UPDATE compiled_release | ||
SET collection_file_id = collection_file_item.collection_file_id | ||
FROM collection_file_item | ||
WHERE collection_file_item_id = collection_file_item.id | ||
""" | ||
), | ||
] |
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
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
Oops, something went wrong.