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

Rewrite column DEFAULTs using the SQL transformer #332

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

andrew-farries
Copy link
Collaborator

Use the SQL transformer added in #329 to rewrite or reject column DEFAULT values.

Column DEFAULT values are user-supplied SQL expressions that may need to be restricted or rewritten in some environments.

pkg/migrations/op_create_table.go Show resolved Hide resolved
Base automatically changed from mock-sql-transformer to main March 28, 2024 07:17
When generating SQL for column defaults in migrations, we now apply the
SQL transformer to the default value. This allows users to transform
default values in migrations.

This applies to columns generated by `OpCreateTable` and `OpAddColumn`.
@andrew-farries andrew-farries merged commit 6334cb4 into main Mar 28, 2024
44 checks passed
@andrew-farries andrew-farries deleted the transform-column-defaults branch March 28, 2024 11:56
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