grate: Database already exists exception - Database Name is always Case Sensitive even when it shouldn't be

When running a deployment I’m getting the following exception raised: Unhandled exception: Microsoft.Data.SqlClient.SqlException (0x80131904): Database 'RetractedDatabaseName' already exists. Choose a different database name.

This is the command line:

-cs "Data Source="RetractedServerName.test.local, 1433";Initial Catalog=RetractedDatabaseName;Trust Server Certificate=True;Authentication=ActiveDirectoryIntegrated" -ct 6000 --verbosity Debug -f Grate

I’m not expecting it to try and create the database!

MacOS BigSur 11.6.1

I suspect this may be due to grate/Configuration/GrateConfiguration Line 52

public bool CreateDatabase { get; init; } = true;

And I’m not finding a corresponding command line option to turn that off.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@erikbra I’m having a hard time finding any negatives to your proposal.

That is correct.

e.g. If my Database Name is HiFiSounds then

Select Db_Id('hifiSOUNDS'), Db_Id('HiFiSounds')

will return back the exact same underlying database_id value. Passing HiFiSounds to grate will work fine, but passing hifiSOUNDS will cause the aforementioned exception.