error while running "pnpm migrate:deploy" for local setup
ClickHouseError: Database openpanel does not exist.
at parseError (C:\projects\OpenSource\openpanel\node_modules.pnpm@[email protected]\node_modules@clickhouse\client-common\dist\error\parse_error.js:34:16)
at ClientRequest.onResponse (C:\projects\OpenSource\openpanel\node_modules.pnpm@[email protected]\node_modules@clickhouse\client\dist\connection\node_base_connection.js:359:59)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
code: '81',
type: 'UNKNOWN_DATABASE'
}
┌──┐
│
│ ❌ Migration Failed ❌
│
│ Error running migration 3-init-ch.ts:
│ Error: Database openpanel does not exist.
│
└──┘
ELIFECYCLE Command failed with exit code 1.
ELIFECYCLE Command failed with exit code 1.
C:\projects\OpenSource\openpanel\packages\db:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL @openpanel/[email protected] migrate:deploy: pnpm migrate:deploy:db && pnpm migrate:deploy:code
Exit status 1
ELIFECYCLE Command failed with exit code 1.
also added all variables in .env in the root
For local development you need to create the database. CREATE DATABASE IF NOT EXISTS openpanel;