mirror of
https://github.com/decompme/decomp.me.git
synced 2026-02-15 10:59:18 -06:00
oopz2
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
# Generated by Django 4.0.2 on 2022-02-20 15:57
|
||||
|
||||
from django.db import migrations
|
||||
import django.db.migrations.operations.special
|
||||
|
||||
|
||||
def assign_forks_to_projects(apps, schema_editor):
|
||||
"""
|
||||
Restore forks' projects
|
||||
"""
|
||||
Scratch = apps.get_model("coreapp", "Scratch")
|
||||
for row in Scratch.objects.all():
|
||||
if row.parent and row.parent.project_function:
|
||||
row.project_function = row.parent.project_function
|
||||
row.save(update_fields=["project_function"]) # type: ignore
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("coreapp", "0015_project_description"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=assign_forks_to_projects,
|
||||
reverse_code=django.db.migrations.operations.special.RunPython.noop,
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user