Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #188 Table '<schemaversions>' doesn't exist #195

Merged
merged 1 commit into from Jun 1, 2016

Conversation

simoncuce
Copy link

When deploying to a newly created MySql database, but there are existing databases with schemaversions table created (and you don't explicitly define the name of the database), the VerifiyTableExistsCommand falls back on a SQL query that will return a false result.

This to avoid this, you needs to ensure that the database name is always defined. If you only pass in a connection string, this doesn't happen. I have thus added some functionaility that if no schema is passed in, then look at the connection string. If it finds a schema name in the connection string use it, else default to the schema name as null

@@ -160,7 +160,7 @@ private bool DoesTableExist()
/// <returns>True if table exists, false otherwise</returns>
private bool VerifyTableExistsCommand(IDbCommand command, string tableName, string schemaName)
{
command.CommandText = string.IsNullOrEmpty(schema)
command.CommandText = string.IsNullOrEmpty(schemaName)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just clean up

@JakeGinnivan JakeGinnivan merged commit 8b5d579 into DbUp:master Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants