Skip to content

Commit

Permalink
migration (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
ieaves authored Sep 12, 2023
1 parent 0d04efe commit 05db2cc
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.5 on 2023-09-12 15:32

from django.db import migrations
from lineage.models import Source


def forwards(apps, schema_editor):
for source in Source.objects.iterator(chunk_size=1000):
source.nodes.remove(*source.nodes.filter(workspace__id__ne=source.workspace))
source.edges.remove(*source.edges.filter(workspace__id__ne=source.workspace))


class Migration(migrations.Migration):
dependencies = [
("lineage", "0016_alter_edge_metadata_alter_node_metadata"),
]

operations = [migrations.RunPython(forwards)]

0 comments on commit 05db2cc

Please sign in to comment.