Golang Tools: database schema migrations

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

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

  • @mgcmsn
    @mgcmsn Год назад +1

    I personally like to make my migrations look as any other database related handler. For example if I use a query builder tools for my repositories, I will use the same style for my migrations.
    I also usually don't make down version of each migration. When something goes wrong I just add a fixing up migration.
    To reduce possibility of a situation when something goes wrong I create tests for my migrations. I rise a fresh db with random name. Roll up all migrations. Run some repo related logic if necessary. Then drop it. Go native testing framework provides a really convenient toolset to make all these operations to run without any manual actions.

  • @simonzuluaga2081
    @simonzuluaga2081 Год назад

    Thanks for the grate video Mario, I had some idea of how migrations work but after this video I'm confident in what they are and how simple it should be to manage them. Excellent video

    • @MarioCarrion
      @MarioCarrion  Год назад

      Thanks Simon! I'm glad you found the video useful. Cheers!

  • @kosnowman
    @kosnowman 3 года назад +2

    hope your subscribers reach 1000 soon! I have subscribed!

    • @MarioCarrion
      @MarioCarrion  3 года назад

      Thanks for the support! Take care

  • @anselminos5238
    @anselminos5238 2 года назад

    writing your own migration tool is probably the best option for people using database libraries that do not implement the standard interface and want to run the every time they run the app.

  • @tomontheinternet
    @tomontheinternet 3 года назад

    Very helpful. Thanks!

  • @TheErudito
    @TheErudito 11 месяцев назад

    No veo como relacionar dos tablas