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

Easier FTL Controller Database Migrations #1839

Closed
alec-brooks opened this issue Jun 20, 2024 · 1 comment · Fixed by #2033
Closed

Easier FTL Controller Database Migrations #1839

alec-brooks opened this issue Jun 20, 2024 · 1 comment · Fixed by #2033
Assignees
Labels

Comments

@alec-brooks
Copy link
Contributor

Right now when managing a deployed FTL cluster, managing database migrations of the controller is a bit inconvenient. It involves copying the database migration files from the FTL repo and then running the migrations using dbmate.
It would be nice if there was some way to perform these migrations without having to do this as it becomes tricky when trying to manage multiple deployed environments with different versions.

I believe there is a tool called ftl-initdb that is used for local dev that has the migration files baked in for the given version. Perhaps the solution here is to allow that tool to take connection strings (it may do already), and have the binaries available somewhere for downloading, but I am not sure if this is necessarily the best path forward, I am open to other suggestions.

@github-actions github-actions bot added the triage Issue needs triaging label Jun 20, 2024
@ftl-robot ftl-robot mentioned this issue Jun 20, 2024
@deniseli deniseli added next Work that will be be picked up next and removed triage Issue needs triaging labels Jun 20, 2024
@matt2e matt2e added the P2 label Jul 1, 2024
@bradleydwyer bradleydwyer self-assigned this Jul 9, 2024
@github-actions github-actions bot removed the next Work that will be be picked up next label Jul 9, 2024
@bradleydwyer bradleydwyer assigned matt2e and unassigned bradleydwyer Jul 9, 2024
@gak gak assigned gak and unassigned matt2e Jul 9, 2024
@gak
Copy link
Contributor

gak commented Jul 10, 2024

As discussed, aim for a ftl migrate command which runs embedded migrations locally.

@gak gak closed this as completed in #2033 Jul 10, 2024
gak added a commit that referenced this issue Jul 10, 2024
Fixes #1839

- Migration files are embedded in the binary, so the binary version
matches the schema.
- Uses `DATABASE_URL` (same as dbmate) or `--dsn` to specify the
connection.

<img width="909" alt="image"
src="https://github.com/TBD54566975/ftl/assets/31338/81b6fc6c-ede4-42c4-a5d5-1ed2d7b02342">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants