Updating export template script to remove users as well.
This commit is contained in:
parent
5a9c8daf7b
commit
449b534db4
|
@ -5,6 +5,10 @@ const { join } = require("path")
|
||||||
const CouchDB = require("../src/db")
|
const CouchDB = require("../src/db")
|
||||||
// load environment
|
// load environment
|
||||||
const env = require("../src/environment")
|
const env = require("../src/environment")
|
||||||
|
const {
|
||||||
|
USER_METDATA_PREFIX,
|
||||||
|
LINK_USER_METADATA_PREFIX,
|
||||||
|
} = require("../src/db/utils")
|
||||||
|
|
||||||
// Script to export a chosen budibase app into a package
|
// Script to export a chosen budibase app into a package
|
||||||
// Usage: ./scripts/exportAppTemplate.js export --name=Funky --appId=appId
|
// Usage: ./scripts/exportAppTemplate.js export --name=Funky --appId=appId
|
||||||
|
@ -44,7 +48,13 @@ yargs
|
||||||
// perform couch dump
|
// perform couch dump
|
||||||
|
|
||||||
const instanceDb = new CouchDB(appId)
|
const instanceDb = new CouchDB(appId)
|
||||||
await instanceDb.dump(writeStream, {})
|
await instanceDb.dump(writeStream, {
|
||||||
|
filter: doc =>
|
||||||
|
!(
|
||||||
|
doc._id.includes(USER_METDATA_PREFIX) ||
|
||||||
|
doc.includes(LINK_USER_METADATA_PREFIX)
|
||||||
|
),
|
||||||
|
})
|
||||||
console.log(`Template ${name} exported to ${exportPath}`)
|
console.log(`Template ${name} exported to ${exportPath}`)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue