Skip to content

Add new migrations framework #232

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

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

ryanrhughes
Copy link
Contributor

Having been burned a few times by migration runs, usually due to me pulling on my own during doing some development, I figured it was time to give a go at a revised migration framework that was a little more resilient than just comparing when we last pulled the repo vs today.

This updated framework seeks to be basically a direct ripoff of what Rails does, and has served us well there for years. A small log is kept at ~/.local/share/omarchy/migration.log (.gitignored) that stores the timestamps of any successful migration runs.

The migrations are ran normally via omarchy-update as they were before but could also be accessed directly via omarchy migrate.

There is also a migrations menu added to the omarchy TUI to allow access to these functions, though we may want to tuck those away in a deeper menu or only have it available on the CLI. While all of these screenshots are from the TUI, both call the same logic.

View Screenshots

Command

image

Tui

image

Status

image

List

image

Create

image

Run migrations (normal)

image

Run migrations (continue on failure prompt)

image

Re-run migration

image

@ryanrhughes
Copy link
Contributor Author

Out of morbid curiosity, I explored what revisions would be required to store in a sqlite db vs log file. It was surprisingly little. ryanrhughes/omarchy@add-new-migrations-framework...ryanrhughes:omarchy:add-new-migrationa-framework-sqlite

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