This commit is contained in:
2023-10-15 23:40:34 +03:00
parent 8d3e8373c0
commit 5ebf3311e4
15 changed files with 393 additions and 240 deletions
+12
View File
@@ -48,4 +48,16 @@ class RecordRepo
DB::table("edges")->whereIn("target", $ids)->delete();
DB::table("revisions")->whereIn("recordId", $ids)->delete();
}
public function deleteTrashedBySchema(
string $schemaName,
): void
{
$ids = DB::table("records")
->where("schema", $schemaName)
->where("status", Status::TRASHED->value)
->get()->pluck("id")->toArray();
$this->deleteMany($ids);
}
}