in functions/schemaLoader.js [58:77]
async function storeSchema(schema, schemaInfo) {
const db = admin.firestore();
const batch = db.batch();
db.collection("glean_schemas");
const latestSchemaRef = db.collection("glean_schemas").doc("latest");
const byDateSchemaRef = db.collection("glean_schemas").doc(schemaInfo.timestamp);
const schemaData = {
deployTimestamp: schemaInfo.timestamp,
commitHash: schemaInfo.hash,
schema: schema,
insertTs: Date.now(),
};
batch.set(latestSchemaRef, schemaData);
batch.set(byDateSchemaRef, schemaData);
return batch.commit();
}