8000 Update `schema.json` to correctly describe the 'alter column' operation by andrew-farries · Pull Request #261 · xataio/pgroll · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update schema.json to correctly describe the 'alter column' operation #261

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

Merged
merged 4 commits into from
Feb 2, 2024

Conversation

andrew-farries
Copy link
Collaborator
@andrew-farries andrew-farries commented Feb 1, 2024

Update schema.json to correctly describe the 'alter column' operation.

The alter column operation is used to perform different alter column operations according to which fields are present.

The rules are:

  • table and column are always required.
  • Exactly one of name, type, check, unique, references, nullable must be present.
  • If type, check, unique, references or nullable is present, then up and down must also be present.
  • If name is present then neither up or down is allowed.

This PR updates schema.json to capture these dependencies.

This change causes churn in the test code as some fields that previously string have become *string.

Fixes #222

@andrew-farries
Copy link
Collaborator Author

I think we should add some tests around schema validation for the 'alter column' operation here too.

@andrew-farries
Copy link
Collaborator Author

I pushed another update to the schema - it fixes the problem where name could be specified alongside other operations like check, nullable etc.

@andrew-farries andrew-farries force-pushed the alter-column-json-schema branch from de5e39c to 18a1955 Compare February 1, 2024 17:26
@andrew-farries
Copy link
Collaborator Author

I've added some tests for JSON schema validation in #263

Copy link
Member
@SferaDev SferaDev left a comment

Choose a reason for hiding this comment

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

Spec also LGTM

@andrew-farries andrew-farries merged commit 5a6a83a into main Feb 2, 2024
@andrew-farries andrew-farries deleted the alter-column-json-schema branch February 2, 2024 09:10
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.

Generated alter_column input type for async migration endpoint is too strict
3 participants
0