FluentMigrator / Postgres:启动数据包中未指定PostgreSQL用户名



尝试在我的开发/本地计算机上运行迁移时,运行良好:

mono packages/FluentMigrator.Tools.1.6.1/tools/AnyCPU/40/Migrate.exe -a Reflect.Web.v2.Migrations/bin/Debug/Reflect.Web.v2.Migrations.dll -db Postgres -conn "Server=localhost;Port=5432;Database=<redacted>;User Id=<redacted>;Password=<redacted>;CommandTimeout=20;" -profile "Debug"

输出这个:

[+] Using Database Postgres and Connection String Server=localhost;Port=5432;Database=<redacted>;User Id=<redacted>;Password=********;CommandTimeout=20;
[+] Task completed.

但是在生产中运行时:

mono /app/packages/FluentMigrator.Tools.1.6.1/tools/AnyCPU/40/Migrate.exe -a Reflect.Web.v2.Migrations.dll -db Postgres -conn "Server=dokku-postgres-reflectdb;Port=5432;Database=<redacted>;User Id=<redacted>;Password=<redacted>;CommandTimeout=20;" -profile "Release"

它抛出

[+] Using Database Postgres and Connection String Server=dokku-postgres-reflectdb
!!! FATAL: 28000: no PostgreSQL user name specified in startup packet
28000: no PostgreSQL user name specified in startup packet

我尝试将用户名参数添加到连接字符串,删除用户 ID 参数等,但无济于事。

可以看到连接字符串不完全可见。不知何故,连接字符串在生产中无法正确分析。

有什么想法吗? :-)

我采取了不同的方法:我运行了 Migrate.exe在迁移项目的 app.config 中传递连接字符串的名称,而不是直接将连接字符串作为参数传递,如下所示:

Migrate.exe -a Reflect.Web.v2.Migrations.dll -db Postgres -conn "NameOfConnectionString" -profile "Release"

这行得通。

最新更新