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

Initialize YAML migration file support #755

Merged
merged 4 commits into from
Mar 27, 2025
Merged

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Mar 26, 2025

This PR adds basic support for reading YAML migration files. From now on users can read migrations from YAML files as well. A migration directory can store both JSON and YAML files at the same time. Ordering of the files is based on the filename without the file extension.

The following migration folder content is valid:

ls migrations
01_create_table.json
02_create_index.yaml
03_create_constraint.json

Also, function that are responsible for reading migration files are ready to handle SQL migrations as well.

This is not the complete support/feature, the PR has several limitations:

  • pgroll reads YAML migration files, but when the user tried to get the migration history pgroll return JSON migrations.
  • Documentation does not show YAML examples

@github-actions github-actions bot temporarily deployed to Docs Preview March 26, 2025 16:25 Inactive
@kvch kvch requested a review from andrew-farries March 26, 2025 16:29
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.

Looks great 👍 Can't wait to start writing YAML migrations 🚀

Co-authored-by: Andrew Farries <andyrb@gmail.com>
@github-actions github-actions bot temporarily deployed to Docs Preview March 27, 2025 10:15 Inactive
Co-authored-by: Andrew Farries <andyrb@gmail.com>
@github-actions github-actions bot temporarily deployed to Docs Preview March 27, 2025 10:15 Inactive
@kvch kvch requested a review from andrew-farries March 27, 2025 10:18
@github-actions github-actions bot temporarily deployed to Docs Preview March 27, 2025 10:18 Inactive
@kvch kvch merged commit 59066a0 into xataio:main Mar 27, 2025
30 checks passed
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