Efficient PostgreSQL Schema Migrations with Node.js and Graphile Migrate

Поделиться
HTML-код
  • Опубликовано: 4 дек 2024

Комментарии • 9

  • @DJazium
    @DJazium Месяц назад

    Woah - very inspiring stuff

  • @diyoptics1387
    @diyoptics1387 3 месяца назад +1

    or `npx graphile-migrate init`

  • @Jason-wx1tv
    @Jason-wx1tv 6 месяцев назад +1

    How would this work for a team of db devs? Would we need to work from the same branch with frequent pull/push or separate branches and merge back into a community branch where conflicts are resolved?

    • @letstalkdev
      @letstalkdev  6 месяцев назад

      Thanks for the question! When collaborating on migrations in separate branches, Graphile Migrate emphasizes a linear commit approach (both git commits as well as migration commits). That is what is so nice about their approach, because if follows a simple git workflow:
      Let's say you're adding a new table and your colleague is modifying a column. Whoever finishes first merges their branch into main. Crucially, they then run `graphile-migrate commit` right after merging. This locks in their changes as a migration file. You then merge or rebase your branch to include the changes from main. Possibly resolving some migration issues if the changes between colleagues are now incompatible and then merge into master. Then you run `graphile-migrate commit` immediately, for your changes, and you're done! This keeps your migration history clean and your database changes predictable. Just like a regular git rebase workflow.
      There is some info about this in the documentation here: github.com/graphile/migrate?tab=readme-ov-file#collaboration

  • @San_OO7
    @San_OO7 7 месяцев назад

    954th sub

    • @letstalkdev
      @letstalkdev  7 месяцев назад

      Thank you so much! We're so close to 1K!