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

Revamp db migrations #10312

Merged
merged 1 commit into from
Mar 4, 2024
Merged

Revamp db migrations #10312

merged 1 commit into from
Mar 4, 2024

Conversation

FredKSchott
Copy link
Member

@FredKSchott FredKSchott commented Mar 4, 2024

Changes

  • Currently, we ask you to manage a migrations/ folder with the astro db gen command. There are some benefits to this system (control, explicit files written to disk) but the downsides are significant (it's an entire thing you need to learn and then manage, and for us it's a fairly complex thing that we need to maintain that can cause really nasty bugs for our users).
  • This new system removes the migrations folder entirely, and instead syncs your schema on-demand. This is much less complex for both user and for us (see the ~400 lines of application logic removed in the diff).
  • The only case that this cannot handle naively -- and the main reason that we didn't pursue this originally -- is when you add and remove a column or table in the same db push command. We'll solve for this in other ways that don't require an entire migrations system.

Progress

  • Remove migrations and update verify/push
  • Add --force-reset flag on db push
  • Add deprecated flag on tables and columns

Testing

  • Tests updated

Docs

  • Docs not yet written

Copy link

changeset-bot bot commented Mar 4, 2024

🦋 Changeset detected

Latest commit: c5a2edd

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@FredKSchott FredKSchott force-pushed the db-gen-2 branch 6 times, most recently from 253d3a4 to 5eb3821 Compare March 4, 2024 10:34
@FredKSchott
Copy link
Member Author

Merging this without an approval so that we have more time to test and review the package starting on Monday.

@FredKSchott FredKSchott merged commit 93ec9e2 into main Mar 4, 2024
13 checks passed
@FredKSchott FredKSchott deleted the db-gen-2 branch March 4, 2024 10:50
@astrobot-houston astrobot-houston mentioned this pull request Mar 4, 2024
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.

1 participant