1
0
Fork 0
mirror of synced 2024-07-05 14:31:17 +12:00

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

View file

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

View file

@ -37,7 +37,7 @@ async function init() {
const envFileJson = { const envFileJson = {
PORT: 4001, PORT: 4001,
MINIO_URL: "http://localhost:4004", 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", REDIS_URL: "localhost:6379",
WORKER_URL: "http://localhost:4002", WORKER_URL: "http://localhost:4002",
INTERNAL_API_KEY: "budibase", INTERNAL_API_KEY: "budibase",

View file

@ -5,7 +5,7 @@ const allDbs = require("pouchdb-all-dbs")
const find = require("pouchdb-find") const find = require("pouchdb-find")
const env = require("../environment") 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(replicationStream.plugin)
PouchDB.plugin(find) PouchDB.plugin(find)

View file

@ -16,7 +16,7 @@ async function init() {
REDIS_URL: "localhost:6379", REDIS_URL: "localhost:6379",
REDIS_PASSWORD: "budibase", REDIS_PASSWORD: "budibase",
MINIO_URL: "http://localhost:4004", 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_USERNAME: "budibase",
COUCH_DB_PASSWORD: "budibase", COUCH_DB_PASSWORD: "budibase",
// empty string is false // empty string is false

View file

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