-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude deleted Entities from form's manifest data (#2648)
* exclude deleted EntityList in endpoint /api/v1/projects * delete form metadata on deleting EntityList * ignore deleted Entity for EntityList dataset export * index deleted_at field for model EntityList, Entity * update dataset info when hard deleting Entity * delete form metadata when EntityList is hard deleted * add test * resolve cyclic dep * resolve cyclic dep * delete EntityList in an atomic transaction * fix failing test * remove unnecessary .all()
- Loading branch information
1 parent
d7e3254
commit 98064d1
Showing
11 changed files
with
240 additions
and
24 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
45 changes: 45 additions & 0 deletions
45
onadata/apps/logger/migrations/0022_entity_logger_enti_deleted_66eee5_idx_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,45 @@ | ||
# Generated by Django 4.2.13 on 2024-07-23 07:38 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
atomic = False | ||
dependencies = [ | ||
("logger", "0021_alter_attachment_options_alter_xform_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.SeparateDatabaseAndState( | ||
database_operations=[ | ||
migrations.RunSQL( | ||
sql=( | ||
'CREATE INDEX CONCURRENTLY "logger_enti_deleted_66eee5_idx" ' | ||
'ON "logger_entity" ("deleted_at");' | ||
), | ||
reverse_sql='DROP INDEX CONCURRENTLY "logger_enti_deleted_66eee5_idx";', | ||
), | ||
migrations.RunSQL( | ||
sql=( | ||
'CREATE INDEX CONCURRENTLY "logger_enti_deleted_476ed6_idx" ' | ||
'ON "logger_entitylist" ("deleted_at");' | ||
), | ||
reverse_sql='DROP INDEX CONCURRENTLY "logger_enti_deleted_476ed6_idx";', | ||
), | ||
], | ||
state_operations=[ | ||
migrations.AddIndex( | ||
model_name="entity", | ||
index=models.Index( | ||
fields=["deleted_at"], name="logger_enti_deleted_66eee5_idx" | ||
), | ||
), | ||
migrations.AddIndex( | ||
model_name="entitylist", | ||
index=models.Index( | ||
fields=["deleted_at"], name="logger_enti_deleted_476ed6_idx" | ||
), | ||
), | ||
], | ||
) | ||
] |
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
Oops, something went wrong.