Skip to content

Commit

Permalink
Fix lineage migration 0017 (#642)
Browse files Browse the repository at this point in the history
* migration

* migration
  • Loading branch information
ieaves authored Sep 12, 2023
1 parent 05db2cc commit 63d5c28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

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


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))
query = Q(workspace=source.workspace)
source.nodes.remove(*source.nodes.filter(~query))
source.edges.remove(*source.edges.filter(~query))


class Migration(migrations.Migration):
Expand Down
2 changes: 1 addition & 1 deletion grai-server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ services:
[
"postgres",
"-c",
"log_statement=all",
"log_statement=none",
"-c",
"wal_level=logical",
"-c",
Expand Down

0 comments on commit 63d5c28

Please sign in to comment.