Evolve icon indicating copy to clipboard operation
Evolve copied to clipboard

Invalid value specified for Database when using configuration file

Open vijayganeshpk opened this issue 3 years ago • 2 comments

Hi, Evolve Tool version: 3.0.0 MacOS: 11.4 (BigSur) dotnet --info:

.NET SDK (reflecting any global.json):
 Version:   6.0.100-preview.5.21302.13
 Commit:    d6380bcae7

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  11.4
 OS Platform: Darwin
 RID:         osx.11.0-x64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.100-preview.5.21302.13/

Host (useful for support):
  Version: 6.0.0-preview.5.21301.5
  Commit:  ec3e0b276b

.NET SDKs installed:
  5.0.301 [/usr/local/share/dotnet/sdk]
  6.0.100-preview.5.21302.13 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-preview.5.21301.17 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-preview.5.21301.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Content of evolve.args.txt:

postgresql -c "Application Name=MyApp;Timezone=UTC;User ID=mydb;Password=mydb;Host=localhost;Port=5432;Database=mydb;Include Error Detail=true;" -l "./MyApp.WebApi/db/migrations" -s mydb --scripts-suffix ".pgsql"

When I try to execute dotnet tool run evolve erase '@evolve.args.txt', I get error:

Invalid value specified for Database. Allowed values are: MySQL, MariaDB, Oracle, PostgreSQL, SQLite, SQLServer, Cassandra, CockroachDB.

But if copy paste the content of the configuration file as part of the command prompt:

dotnet tool run evolve erase postgresql -c "Application Name=MyApp;Timezone=UTC;User ID=mydb;Password=mydb;Host=localhost;Port=5432;Database=mydb;Include Error Detail=true;" -l "./MyApp.WebApi/db/migrations" -s mydb --scripts-suffix ".pgsql"

it executes without a problem.

Evolve initialized.
Schema mydb does not exist.
Schema mydb created.
Executing Erase...
Successfully dropped schema mydb.
Erase schema(s) completed: 1 erased, 0 skipped.

Any ideas what could be causing problems when trying to use configuration file?

Thanks

vijayganeshpk avatar Jul 25 '21 19:07 vijayganeshpk

Hi,

First, nerver tried with .Net6 Maybe test without the quotes surrounding the args.txt param ?

lecaillon avatar Jul 25 '21 19:07 lecaillon

Thanks @lecaillon

I am not sure .Net 6 is an issue as using the same parameters without configuration file seems to work fine.

I also tried without the surrounding quotes, but no luck. I am following the example as given at https://evolve-db.netlify.app/getting-started/tool/

vijayganeshpk avatar Jul 25 '21 20:07 vijayganeshpk