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

chore: better database migrations - managed by supabase #570

Merged
merged 12 commits into from
Jun 10, 2024

Conversation

YrrepNoj
Copy link
Member

@YrrepNoj YrrepNoj commented May 29, 2024

This PR introduces a new approach to how we perform data migrations for our LFAI applications.

  1. Instead of running the migration scripts as part of the entrypoint scripts of the POSTGRES containers we are running the migrations as a k8s job for each deployment that needs the migration (in this case the API and UI deployments).
  2. Instead of running the migration scripts with raw PSQL we are utilizing the supabase cli to perform and manage our migrations.
  • The supabase CLI helps manage our migrations by tracking the history of past migration scripts that got run. With the CLI rerunning the same migration will not break as it will know the migration script already ran and won't attempt to re-run it.

Copy link

netlify bot commented May 29, 2024

Deploy Preview for leapfrogai-docs canceled.

Name Link
🔨 Latest commit fa013d2
🔍 Latest deploy log https://app.netlify.com/sites/leapfrogai-docs/deploys/6667240cf828ab0008c3890b

@YrrepNoj YrrepNoj force-pushed the 486-better-database-migrations branch 2 times, most recently from 4278bcf to 651c122 Compare June 5, 2024 16:28
@YrrepNoj YrrepNoj force-pushed the 486-better-database-migrations branch from 651c122 to 7ef3b07 Compare June 5, 2024 16:46
@YrrepNoj YrrepNoj changed the title 486 better database migrations chore: better database migrations - managed by supabase Jun 5, 2024
@YrrepNoj YrrepNoj marked this pull request as ready for review June 5, 2024 16:49
@YrrepNoj YrrepNoj requested a review from a team as a code owner June 5, 2024 16:49
jalling97
jalling97 previously approved these changes Jun 6, 2024
packages/api/supabase/Dockerfile Outdated Show resolved Hide resolved
src/leapfrogai_ui/supabase/Dockerfile Outdated Show resolved Hide resolved
@YrrepNoj YrrepNoj merged commit ce6512f into main Jun 10, 2024
11 checks passed
@YrrepNoj YrrepNoj deleted the 486-better-database-migrations branch June 10, 2024 18:33
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.

3 participants