Deprovision and local couch db url fix

This commit is contained in:
Rory Powell 2022-02-18 17:36:23 +00:00
parent da9be1b20a
commit 02c0c49594
6 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,5 @@
const { getGlobalUserParams, getAllApps } = require("../db/utils")
const { getDB, getCouch } = require("../db")
const { getDB } = require("../db")
const { getGlobalDB } = require("../tenancy")
const { StaticDatabases } = require("../db/constants")
@ -79,7 +79,7 @@ const removeGlobalDB = async tenantId => {
const removeTenantApps = async tenantId => {
try {
const apps = await getAllApps(getCouch(), { all: true })
const apps = await getAllApps({ all: true })
const destroyPromises = apps.map(app => getDB(app.appId).destroy())
await Promise.allSettled(destroyPromises)
} catch (err) {

View File

@ -22,6 +22,7 @@ exports.getMigrationsDoc = async db => {
if (err.status && err.status === 404) {
return { _id: DocumentTypes.MIGRATIONS }
}
console.error(err)
}
}

View File

@ -37,7 +37,7 @@ async function init() {
const envFileJson = {
PORT: 4001,
MINIO_URL: "http://localhost:4004",
COUCH_DB_URL: "http://budibase:budibase@localhost:10000/db/",
COUCH_DB_URL: "http://budibase:budibase@localhost:4005",
REDIS_URL: "localhost:6379",
WORKER_URL: "http://localhost:4002",
INTERNAL_API_KEY: "budibase",

View File

@ -5,7 +5,7 @@ const allDbs = require("pouchdb-all-dbs")
const find = require("pouchdb-find")
const env = require("../environment")
const COUCH_DB_URL = getCouchUrl() || "http://localhost:10000/db/"
const COUCH_DB_URL = getCouchUrl() || "http://localhost:4005"
PouchDB.plugin(replicationStream.plugin)
PouchDB.plugin(find)

View File

@ -16,7 +16,7 @@ async function init() {
REDIS_URL: "localhost:6379",
REDIS_PASSWORD: "budibase",
MINIO_URL: "http://localhost:4004",
COUCH_DB_URL: "http://budibase:budibase@localhost:10000/db/",
COUCH_DB_URL: "http://budibase:budibase@localhost:4005",
COUCH_DB_USERNAME: "budibase",
COUCH_DB_PASSWORD: "budibase",
// empty string is false

View File

@ -4,7 +4,7 @@ const env = require("../environment")
const { getCouchUrl } = require("@budibase/backend-core/db")
// level option is purely for testing (development)
const COUCH_DB_URL = getCouchUrl() || "http://localhost:10000/db/"
const COUCH_DB_URL = getCouchUrl() || "http://localhost:4005"
let POUCH_DB_DEFAULTS = {
prefix: COUCH_DB_URL,