Skip to content

Commit

Permalink
Fi child name in setup and destroy as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Brecht De Rooms committed Apr 30, 2020
1 parent 12e4ae9 commit 2eb600c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const deleteAll = async client => {
// easily without having to wait for cache invalidation of collection/index names.
// In this case, we can just nuke the database completely.
const childDbName = process.env.REACT_APP_LOCAL___CHILD_DB_NAME
if (typeof childDbName !== 'undefined') {
if (typeof childDbName !== 'undefined' && childDbName !== '') {
// clean keys that are linked to this database
await handleSetupError(
client.query(
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const main = async () => {
}
let client = new faunadb.Client({ secret: adminKey })

if (typeof childDbName !== 'undefined') {
if (typeof childDbName !== 'undefined' && childDbName !== '') {
await handleSetupError(
client.query(If(Exists(Database(childDbName)), false, CreateDatabase({ name: childDbName }))),
'database - create child database'
Expand Down

0 comments on commit 2eb600c

Please sign in to comment.