Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprovision and local couch db url fix #4571

Merged
merged 1 commit into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/backend-core/src/context/deprovision.js
Original file line number Diff line number Diff line change
@@ -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")

Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exports.getMigrationsDoc = async db => {
if (err.status && err.status === 404) {
return { _id: DocumentTypes.MIGRATIONS }
}
console.error(err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/server/scripts/dev/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/db/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/scripts/dev/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/db/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down