mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Migrate albums and pictures to their own tables
This commit is contained in:
27
core/migrations/0046_remove_sithfiles.py
Normal file
27
core/migrations/0046_remove_sithfiles.py
Normal file
@ -0,0 +1,27 @@
|
||||
# Generated by Django 4.2.17 on 2025-01-26 15:01
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from django.db import migrations
|
||||
from django.db.migrations.state import StateApps
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import core.models
|
||||
|
||||
|
||||
def remove_sas_sithfiles(apps: StateApps, schema_editor):
|
||||
SithFile: type[core.models.SithFile] = apps.get_model("core", "SithFile")
|
||||
SithFile.objects.filter(is_in_sas=True).delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("core", "0045_quickuploadimage"),
|
||||
("sas", "0006_alter_peoplepicturerelation_picture_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
remove_sas_sithfiles, reverse_code=migrations.RunPython.noop, elidable=True
|
||||
)
|
||||
]
|
9
core/migrations/0047_remove_sithfile_is_in_sas.py
Normal file
9
core/migrations/0047_remove_sithfile_is_in_sas.py
Normal file
@ -0,0 +1,9 @@
|
||||
# Generated by Django 4.2.17 on 2025-02-14 11:58
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [("core", "0046_remove_sithfiles")]
|
||||
|
||||
operations = [migrations.RemoveField(model_name="sithfile", name="is_in_sas")]
|
Reference in New Issue
Block a user