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

Alter column operations should allow specification of unchanged fields #339

Open
andrew-farries opened this issue Apr 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@andrew-farries
Copy link
Collaborator

Alter column operations should support specifying fields that are unchanged as no-ops.

For example, this migration:

{
  "name": "35_alter_column_multiple",
  "operations": [
    {
      "alter_column": {
        "table": "events",
        "column": "name",
        "name": "event_name",
        "nullable": false,
        "up": "(SELECT CASE WHEN name IS NULL THEN 'placeholder' ELSE name END)",
        "down": "name"
      }
    }
  ]
}

Renames a field and sets it to NOT NULL. If the field is already NOT NULL, the operation should not perform any column duplication or backfilling to support setting the column nullability.

@andrew-farries andrew-farries added the enhancement New feature or request label Apr 12, 2024
@andrew-farries andrew-farries added this to the v1 milestone Apr 12, 2024
@andrew-farries andrew-farries self-assigned this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant