Skip to content

最新版0.2.26升级时数据库迁移失败, 导致服务起不来 #65

@bxhzzx

Description

@bxhzzx
claude-code-hub-app  | {"level":"error","time":1762089970517,"pid":1,"hostname":"4c176697b855","err":{"type":"y","message":"Failed query: CREATE TABLE \"notification_settings\" (\n\t\"id\" serial PRIMARY KEY NOT NULL,\n\t\"enabled\" boolean DEFAULT false NOT NULL,\n\t\"circuit_breaker_enabled\" boolean DEFAULT false NOT NULL,\n\t\"circuit_breaker_webhook\" varchar(512),\n\t\"daily_leaderboard_enabled\" boolean DEFAULT false NOT NULL,\n\t\"daily_leaderboard_webhook\" varchar(512),\n\t\"daily_leaderboard_time\" varchar(10) DEFAULT '09:00',\n\t\"daily_leaderboard_top_n\" integer DEFAULT 5,\n\t\"cost_alert_enabled\" boolean DEFAULT false NOT NULL,\n\t\"cost_alert_webhook\" varchar(512),\n\t\"cost_alert_threshold\" numeric(5, 2) DEFAULT '0.80',\n\t\"cost_alert_check_interval\" integer DEFAULT 60,\n\t\"created_at\" timestamp with time zone DEFAULT now(),\n\t\"updated_at\" timestamp with time zone DEFAULT now()\n);\n\nparams: : relation \"notification_settings\" already exists","stack":"Error: Failed query: CREATE TABLE \"notification_settings\" (\n\t\"id\" serial PRIMARY KEY NOT NULL,\n\t\"enabled\" boolean DEFAULT false NOT NULL,\n\t\"circuit_breaker_enabled\" boolean DEFAULT false NOT NULL,\n\t\"circuit_breaker_webhook\" varchar(512),\n\t\"daily_leaderboard_enabled\" boolean DEFAULT false NOT NULL,\n\t\"daily_leaderboard_webhook\" varchar(512),\n\t\"daily_leaderboard_time\" varchar(10) DEFAULT '09:00',\n\t\"daily_leaderboard_top_n\" integer DEFAULT 5,\n\t\"cost_alert_enabled\" boolean DEFAULT false NOT NULL,\n\t\"cost_alert_webhook\" varchar(512),\n\t\"cost_alert_threshold\" numeric(5, 2) DEFAULT '0.80',\n\t\"cost_alert_check_interval\" integer DEFAULT 60,\n\t\"created_at\" timestamp with time zone DEFAULT now(),\n\t\"updated_at\" timestamp with time zone DEFAULT now()\n);\n\nparams: \n    at av.queryWithCache (/app/.next/server/chunks/1617.js:8:34779)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async /app/.next/server/chunks/1617.js:8:359\n    at async g (/app/.next/server/chunks/1617.js:35:10446)\n    at async Function.E [as begin] (/app/.next/server/chunks/1617.js:35:10019)\n    at async O.migrate (/app/.next/server/chunks/1617.js:8:245)\n    at async g (/app/.next/server/chunks/780.js:1:753)\n    at async m (/app/.next/server/chunks/780.js:1:1109)\n    at async Module.e (/app/.next/server/instrumentation.js:36:12580)\n    at async registerInstrumentation (/app/node_modules/.pnpm/next@15.5.6_@babel+core@7.28.5_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js:63:13)\ncaused by: k: relation \"notification_settings\" already exists\n    at S (/app/.next/server/chunks/1617.js:18:2034)\n    at /app/.next/server/chunks/1617.js:18:3080\n    at Socket.aN (/app/.next/server/chunks/1617.js:18:3084)\n    at Socket.emit (node:events:519:28)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at TCP.onStreamRead (node:internal/stream_base_commons:189:23)","query":"CREATE TABLE \"notification_settings\" (\n\t\"id\" serial PRIMARY KEY NOT NULL,\n\t\"enabled\" boolean DEFAULT false NOT NULL,\n\t\"circuit_breaker_enabled\" boolean DEFAULT false NOT NULL,\n\t\"circuit_breaker_webhook\" varchar(512),\n\t\"daily_leaderboard_enabled\" boolean DEFAULT false NOT NULL,\n\t\"daily_leaderboard_webhook\" varchar(512),\n\t\"daily_leaderboard_time\" varchar(10) DEFAULT '09:00',\n\t\"daily_leaderboard_top_n\" integer DEFAULT 5,\n\t\"cost_alert_enabled\" boolean DEFAULT false NOT NULL,\n\t\"cost_alert_webhook\" varchar(512),\n\t\"cost_alert_threshold\" numeric(5, 2) DEFAULT '0.80',\n\t\"cost_alert_check_interval\" integer DEFAULT 60,\n\t\"created_at\" timestamp with time zone DEFAULT now(),\n\t\"updated_at\" timestamp with time zone DEFAULT now()\n);\n","params":[]},"msg":"❌ Migration failed:"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions