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

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

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

schema.json Outdated Show resolved Hide resolved
schema.json Show resolved Hide resolved
@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
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
26 checks passed
@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