-e-6ren">
gpt4 book ai didi

postgresql - docker ,错误: cannot run migrations: database needs bootstrapping;

转载 作者:行者123 更新时间:2023-11-29 12:01:45 24 4
gpt4 key购买 nike

这是我试过的

docker run --rm \
> --link kong-database:kong-database \
> -e "KONG_DATABASE=postgres" \
> -e "KONG_PG_HOST=kong-database" \
> kong:latest kong migrations up

可是我有

Error: cannot run migrations: database needs bootstrapping; run 'kong migrations bootstrap'

我不明白这到底是什么意思。如果我尝试

docker run --rm --link kong-database:kong-database -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=kong-database" kong:latest kong migrations bootstrap
bootstrapping database...
Error: [PostgreSQL error] failed to bootstrap database: ERROR: syntax error at or near "NOT" (150)

我检查了kong-database

 {
"Id": "d94ac442da9a399c1b865de49904e01085abe1ed8f0871af5830810c4c2a78dd",
"Created": "2019-04-19T07:18:59.534751317Z",
"Path": "docker-entrypoint.sh",
"Args": [
"postgres"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 18342,
"ExitCode": 0,
"Error": "",
"StartedAt": "2019-04-19T07:19:00.129193458Z",
"FinishedAt": "0001-01-01T00:00:00Z"

为什么我需要引导数据库,为什么会出现问题?

最佳答案

您必须在运行 kong 之前引导数据库。 up 命令已弃用并替换为 bootstrap

改变

kong:最新的 kong 迁移

kong:最新的 kong 迁移 Bootstrap

关于postgresql - docker ,错误: cannot run migrations: database needs bootstrapping;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55758204/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com