Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
bugfix(sanity-keys): added new manual script to delete key & executed…
Browse files Browse the repository at this point in the history
… Sanity commands to delete rogue key; (#4505)

Co-authored-by: VWSCoronaDashboard19 <[email protected]>
  • Loading branch information
VWSCoronaDashboard26 and hasan-ozaynaci authored Nov 21, 2022
1 parent 16e3fd5 commit cf110b7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/cms/src/migrations/sprint59/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* THIS SCRIPT DELETES DATA!
*
* To use this script:
* 1. Run `sanity dataset export` to backup your dataset before deleting a bunch of documents
* 2. Run `sanity exec src/migrations/sprint59 --with-user-token` to delete the documents
*
* NOTE: For the time being you should not delete more than ~1000 documents in one transaction. This will change in the future.
* See docs:https://www.sanity.io/docs/http-api/http-mutations#deleting-multiple-documents-by-query
*/

import { getClient } from '../../client';
const client = getClient('development');

client
.delete({
query: `*[_type == "lokalizeText" && [_id] match "c39981a1-bfa4-4aec-bf65-f0143820e150"]`,
})
.then(console.log)
.catch(console.error);

0 comments on commit cf110b7

Please sign in to comment.