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

Add support for DropDatabase #17

Merged
merged 7 commits into from
Oct 22, 2024
Merged

Add support for DropDatabase #17

merged 7 commits into from
Oct 22, 2024

Conversation

scorixear
Copy link
Contributor

Checklist

  • I have read the Contributing Guide
  • I have checked to ensure this does not introduce an unintended breaking changes
  • I have considered appropriate testing for my change

Description

Adds three additional extension methods for SupportedDatabasesForDropDatabase allowing MySql to be used
in the same manner as the DbUp.SqlServer package.

DbUp.DropDatabase.For.MySqlDatabase(connectionstring);

Method signatures and implementation are mainly taken from DbUp.SqlServer and the already existent SupportedDatabasesForEnsureDatabase extension methods.

DbUp.SqlServer introduces an additional alter statement before dropping

ALTER DATABASE [{databaseName}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

There is no equivalent in MySql for this.
The possibility to read lock all databases with

FLUSH TABLES WITH READ LOCK;

was considered but not implemented as it affects all databases. The drop command will fail fast, if any connection is still present.

droyad and others added 4 commits March 20, 2024 10:20
* Only target netstandard 2.0

* Removed install of net 2.0

* Moved CI optimisations into just the main project

* Fix Readme and template

* Build on Ubuntu (DbUp#12)

* Build on Ubuntu

* Used bash variables

* Used re-usable workflow

* Specified the branch

* Used .github/workflow/ path for workflows

* Fix name

* Used root workflow folder

* passed secret explicitly

* fix

* Not pass secret

* Changed branch
@droyad droyad enabled auto-merge (squash) July 29, 2024 07:05
droyad
droyad previously approved these changes Jul 29, 2024
Copy link
Member

@droyad droyad left a comment

Choose a reason for hiding this comment

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

Very nice, thank you. Going into v5.

@droyad droyad self-assigned this Jul 29, 2024
auto-merge was automatically disabled July 29, 2024 15:29

Head branch was pushed to by a user without write access

@scorixear
Copy link
Contributor Author

@droyad Not sure why the test is failing, I have reordered the methods in the ApprovalFiles, maybe that fixes something

@droyad droyad changed the base branch from main to release/6.0.0 October 22, 2024 11:35
# Conflicts:
#	.github/workflows/test-report.yml
#	src/Tests/ApprovalFiles/NoPublicApiChanges.Run.Net.verified.cs
@droyad droyad merged commit 1250c8c into DbUp:release/6.0.0 Oct 22, 2024
2 checks passed
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.

2 participants