Migrations Done Right in .NET

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

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

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

    I was looking for something like this ! Very nice and simple thanks a lot ! I was aware depends on docker but I was not aware condition and DbUp package simple to use !

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

    Looks very promising! Will definitely consider it as a replacement for my current EF Core setups :D

  • @ahmadalsader1047
    @ahmadalsader1047 3 месяца назад +2

    Thank you for your effort, Can you talk about profiling the application ?

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

    Thank you!

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

    What is advantage of this over EF Core Migrations? I didn't hear a single one mentioned in the video. I can think of several disadvantages such as more work to setup, more work to (manually???) create each migration, and less community knowledge/support available. I really don't get why I would want to use this.

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

      I used this in project many years ago where there wasn't an ORM. Not everyone uses ORM's.

    • @meetingattender8132
      @meetingattender8132 2 месяца назад

      Don't use it unless you like to write raw SQL manually to have more control. If you use an ORM like EF Core stay away from this.

  • @alcoholrelated4529
    @alcoholrelated4529 2 месяца назад

    so, are we introducing a dependency to read embedded resources? :)

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

    I like your videos Amichai, but don't agree with use of GUID as PK aka ClusterKey in tables.

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

    I have used dbup (and it's sisters) for years too, but the docker-compose-healthy is cool! Nice takeaway!

  • @erikgrundy
    @erikgrundy 3 месяца назад

    how do you find this compares to ef core migrations. this seems more straightforward for changes like the one you made in this video, but i wonder if it wouldn't get unwieldy for more involved changes.

  • @soucianceeqdamrashti8175
    @soucianceeqdamrashti8175 3 месяца назад +4

    Nice walkthrough! If you are already using EF, what is the difference between asking EF to run migrations on startup and using DbUp? Seems like the same thing right?

    • @PeriMCS
      @PeriMCS 3 месяца назад

      you should not run migrations at startup on any env other then dev. You run migrations before deployment and they always need to be backwards compatible.

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

      ​@@PeriMCS in one of my company's products we have a microservices architecture and each service is self-executing migrations on the startup. And for years we never had an issue where we needed to downgrade the database in production because of this approach

    • @PeriMCS
      @PeriMCS 3 месяца назад

      @@antonmartyniuk you don't downgrade db. You should always have db that works with current and previous version of your app.

    • @PeriMCS
      @PeriMCS 3 месяца назад

      @@antonmartyniuk and how you handle it when service doing migration at startup is running in multiple instances?

    • @antonmartyniuk
      @antonmartyniuk 3 месяца назад

      @@PeriMCS these instances connect to the same database 😉
      Whether to use this approach or not - actually it all depends on the requirements and use cases

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

    Hey! How do you have this copilot-like terminal autocompletion?

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

      I think it's just Powershell

  • @ajdinhusic2574
    @ajdinhusic2574 2 месяца назад

    Hi @Amichai Mantinband, thanks for the great video!
    I have one question though, DbUp doesn't seem to support rollback (Down) migrations. Do you think this is a problem?

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

    How does DbUp compare to EF Core migrations, or why did you choose the first over the latter?

    • @PeriMCS
      @PeriMCS 3 месяца назад

      he is not using EF. Only then it makes sense.

    • @meetingattender8132
      @meetingattender8132 2 месяца назад +1

      Do not chose this. Use EF Core migrations.

    • @PeriMCS
      @PeriMCS 2 месяца назад

      @@meetingattender8132 this is not Or. You choose it when you write scripts.

  • @aweklin
    @aweklin 3 месяца назад

    Thanks Amichai. I love SQL server so much. So, how do I setup my docker compose for it, especially with those comands you specified in the depends_on section?

  • @DaminGamerMC
    @DaminGamerMC 3 месяца назад

    but that means it will try to create the tables every time we run the application right? if that is the case I feel something is not right.

    • @DanielOpitz
      @DanielOpitz 3 месяца назад

      DbUp tracks the scripts that have already been executed in a table (SchemaVersions).

    • @meetingattender8132
      @meetingattender8132 2 месяца назад

      No it's just like __EFMigrationHistory of EF Core

  • @DanielOpitz
    @DanielOpitz 3 месяца назад

    Very cool. How do you "diff" the old schema of the database with the new schema?

    • @ajdinhusic2574
      @ajdinhusic2574 2 месяца назад

      this is handled by DbUp, using a database table called SchemaVersions

    • @DanielOpitz
      @DanielOpitz 2 месяца назад

      @@ajdinhusic2574 This table just marks the migrated versions.

    • @ajdinhusic2574
      @ajdinhusic2574 2 месяца назад

      @@DanielOpitz Right, so what exactly do you mean by "diff" the schemas. And for what purpose?

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

    baldy