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

Allow applications to handle DatabaseMigrator schema changes. #1651

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

groue
Copy link
Owner

@groue groue commented Oct 12, 2024

This PR addresses #1650.

When eraseDatabaseOnSchemaChange does not exactly fit your needs, you can implement it manually as below:

#if DEBUG
// Speed up development by nuking the database when migrations change
if dbQueue.read(migrator.hasSchemaChanges) {
    // Perform necessary logic, before and after content erasure
    try dbQueue.erase()
}
#endif
try migrator.migrate(dbQueue)

@groue groue merged commit 7cd075b into development Oct 12, 2024
8 checks passed
@groue groue deleted the dev/hasSchemaChanges branch October 12, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant