From a52b2992afc10bbe82ff62cf311a21624f170eb6 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Tue, 25 Jan 2022 15:13:11 -0600 Subject: [PATCH] Back up comments and bets subcollections too --- functions/src/backup-db.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/src/backup-db.ts b/functions/src/backup-db.ts index db2df27d..45a06b83 100644 --- a/functions/src/backup-db.ts +++ b/functions/src/backup-db.ts @@ -1,4 +1,5 @@ -// Export script from https://firebase.google.com/docs/firestore/solutions/schedule-export +// This code is copied from https://firebase.google.com/docs/firestore/solutions/schedule-export +// To deploy after any changes: `yarn deploy` // To import the data into dev Firestore: https://firebase.google.com/docs/firestore/manage-data/move-data import * as functions from 'firebase-functions' @@ -20,12 +21,15 @@ export const backupDb = functions.pubsub // Leave collectionIds empty to export all collections // or set to a list of collection IDs to export, // collectionIds: ['users', 'posts'] + // NOTE: Subcollections are not backed up by default collectionIds: [ 'contracts', 'folds', 'private-users', 'stripe-transactions', 'users', + 'bets', + 'comments', ], }) .then((responses) => {