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

feat/multi-version-schema-migrations #349

Merged
merged 21 commits into from
Jul 16, 2024
Merged

Conversation

eemmiillyy
Copy link
Contributor

@eemmiillyy eemmiillyy commented Jun 26, 2024

Documentation for multi-version schema migrations

@xata-bot
Copy link

xata-bot commented Jun 26, 2024

Check out the preview at https://xata-docs-pr-349.vercel.app

050-Manage/060-migrations-multischema.mdx Outdated Show resolved Hide resolved
@eemmiillyy eemmiillyy requested a review from alexfrancoeur June 27, 2024 07:21
@@ -0,0 +1,56 @@
---
title: Multi Schema Migrations
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
title: Multi Schema Migrations
title: Multi schema migrations

Sentence format to match other docs pages

Copy link
Contributor

Choose a reason for hiding this comment

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

As I read this blog, I'm realizing that this is being productized as multi-schema migrations. We've always used this internally to discuss the feature, but I'm not sure if it'll be confusing externally. What are yours and @andrew-farries @exekias @tsg on calling this "Reversible schema migrations" or "Simultaneous schema migrations" or "Virtual schema migrations". Just brainstorming here. Part of the problem is we have two was to do migrations at the moment. When there's one, we don't really have to differentiate in the docs. We could also combine into the same migrations page, and differentiate for postgres dbs vs. not.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can also call it "Online / Live Schema Migrations"? That's the term I am aware of with products that feel the most similar to pgroll like https://github.com/github/gh-ost

Copy link
Contributor

@alexfrancoeur alexfrancoeur left a comment

Choose a reason for hiding this comment

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

I dropped in a few comments primarily about the naming and differentiation from the existing migrations. The rest of the docs look good overall. I also like having a manage section, but we may want @snide's input since he came up with the original IA.

What's missing for me here are copy and pasteable examples. I want to change my column name, here's some code to copy, etc. Last time we spoke about this, we talked about referencing the pgroll operations or even actually pulling them in directly (similar to mdx-blog, mdx-docs, etc.). The problem with just pointing to the repo, is that "changing a column type" isn't searchable in our docs.

This is a great overview and walk through! Since we are lacking UI around the actual operations and are relying on JSON, I have a feeling we'll need examples for the most common schema changes you'd make.

I'm also thinking we may want to include any and all limitations in the docs.

status: beta
---

Multi Schema migrations address the pain point of having to keep your application code in sync with your database schema by allowing you two active database schemas at once. With Multi Schema migrations, running a migration means being able to preview the new version of your schema alongside the old one. Reading and writing data in both schemas continues to work normally. As a result of having two active schema versions, rollbacks become seamless operations which is particularly useful in the case of an unwanted schema change or backfill.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably worth highlighting and linking to pgroll int this intro blog, just so folks know what the underlying technology is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added. Just need to verify the link is correct

@@ -0,0 +1,56 @@
---
title: Multi Schema Migrations
Copy link
Contributor

Choose a reason for hiding this comment

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

As I read this blog, I'm realizing that this is being productized as multi-schema migrations. We've always used this internally to discuss the feature, but I'm not sure if it'll be confusing externally. What are yours and @andrew-farries @exekias @tsg on calling this "Reversible schema migrations" or "Simultaneous schema migrations" or "Virtual schema migrations". Just brainstorming here. Part of the problem is we have two was to do migrations at the moment. When there's one, we don't really have to differentiate in the docs. We could also combine into the same migrations page, and differentiate for postgres dbs vs. not.

@eemmiillyy eemmiillyy changed the title feat/multischema-migrations feat/multi-version-schema-migrations Jul 1, 2024
@eemmiillyy eemmiillyy requested a review from alexfrancoeur July 1, 2024 08:52
@eemmiillyy
Copy link
Contributor Author

@alexfrancoeur I made the requested changes, please let me know if I missed anything :) Using the term "multi-version schema migrations" now. I also added some examples of common pgroll ops, and merged this page with the existing migrations page.

Copy link
Contributor

@alexfrancoeur alexfrancoeur left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here @eemmiillyy ! The docs look great. I added a few minor suggestions and ideas. I forget where we landed for July, but if we can apply multi-version schema migrations through the CLI, it's worth documenting.

I hope this helps, let me know if you have any questions or need clarification on any of my feedback. It's all pretty minor.

050-Manage/030-migrations.mdx Outdated Show resolved Hide resolved
050-Manage/030-migrations.mdx Show resolved Hide resolved
050-Manage/030-migrations.mdx Outdated Show resolved Hide resolved
050-Manage/030-migrations.mdx Show resolved Hide resolved
050-Manage/030-migrations.mdx Outdated Show resolved Hide resolved
050-Manage/030-migrations.mdx Outdated Show resolved Hide resolved
050-Manage/030-migrations.mdx Outdated Show resolved Hide resolved
050-Manage/030-migrations.mdx Show resolved Hide resolved
@eemmiillyy
Copy link
Contributor Author

@alexfrancoeur Thanks! For multi-version (using start/complete/rollback) for migrations in CLI we haven't started AFAIK. I think it would require some UX changes. I started a thread about it here: https://xata-hq.slack.com/archives/C05TR0HPQ9Y/p1720607406000149?thread_ts=1720606948.589919&cid=C05TR0HPQ9Y

@eemmiillyy eemmiillyy requested a review from alexfrancoeur July 11, 2024 12:56
Copy link
Contributor

@alexfrancoeur alexfrancoeur left a comment

Choose a reason for hiding this comment

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

Overall this LGTM. I think we can iterate if needed down the road. Thanks @eemmiillyy !

@eemmiillyy eemmiillyy enabled auto-merge July 16, 2024 06:51
@eemmiillyy eemmiillyy requested a review from philkra July 16, 2024 07:35
@eemmiillyy eemmiillyy dismissed philkra’s stale review July 16, 2024 07:36

Made the changes :)

@eemmiillyy eemmiillyy added this pull request to the merge queue Jul 16, 2024
Merged via the queue into main with commit c57fa09 Jul 16, 2024
5 checks passed
@eemmiillyy eemmiillyy deleted the feat/migrations-multi-schema branch July 16, 2024 07:36
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.

5 participants