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 to disable version schemas #233

Merged
merged 2 commits into from
Jan 15, 2024
Merged

Allow to disable version schemas #233

merged 2 commits into from
Jan 15, 2024

Conversation

exekias
Copy link
Member

@exekias exekias commented Jan 15, 2024

There are situatiosn were creating schema verisons is not required. This internal flag will allow to disable creating & managing these schemas when needed.

Note: I opted to not expose this flag to the CLI as I believe it would make create more harm & confusion than not having the feature there.

There are situatiosn were creating schema verisons is not required. This
internal flag will allow to disable creating & managing these schemas
when needed.

Note: I opted to not expose this flag to the CLI as I believe it would
make create more harm & confusion than not having the feature there.
Copy link
Collaborator

@andrew-farries andrew-farries left a comment

Choose a reason for hiding this comment

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

Code looks fine, apart from one suggestion around the tests.

In what situations do you imagine we will need the flag?

if schemaExists(t, db, roll.VersionedSchemaName(schema, version)) {
t.Errorf("Expected schema %q to not exist", version)
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it worth testing the behaviour on rollback here too? Rolling back the migration shouldn't try to delete the version schema if it wasn't created, so attempting a rollback and asserting no error here might be worth adding.

@exekias exekias merged commit 83b5d76 into main Jan 15, 2024
24 checks passed
@exekias exekias deleted the disable-schemas-management branch January 15, 2024 15:42
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