Migrations Done Right in .NET

Поділитися
Вставка
  • Опубліковано 29 лис 2024

КОМЕНТАРІ • 55

  • @SakuraIsayeki
    @SakuraIsayeki 5 місяців тому +3

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

  • @andersjuul8310
    @andersjuul8310 5 місяців тому +1

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

  • @stephenyork7318
    @stephenyork7318 5 днів тому

    I don't get the db creation you talk about at 9:26. I get "one-review-db | PostgreSQL Database directory appears to contain a database; Skipping initialization". And that's after starting from scratch removing all the containers and images, but I do get this which you don't mention "one-review-db | 2024-11-25 02:08:26.620 UTC [50] FATAL: role "postgres" does not exist"

  • @emiraksoy1520
    @emiraksoy1520 5 місяців тому +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 !

  • @stephenyork7318
    @stephenyork7318 5 днів тому

    I love the way you have your head over the sql so we have to pay for your patreon to even see the code you're presenting in this video. If you wantus to pay, then make it an extra vid, not part of the core free video series.

  • @RandallEike
    @RandallEike 5 місяців тому +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 5 місяців тому +3

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

    • @meetingattender8132
      @meetingattender8132 4 місяці тому

      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.

  • @ahmadalsader1047
    @ahmadalsader1047 5 місяців тому +2

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

  • @ajdinhusic2574
    @ajdinhusic2574 4 місяці тому

    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?

  • @soucianceeqdamrashti8175
    @soucianceeqdamrashti8175 5 місяців тому +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 5 місяців тому

      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 5 місяців тому +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 5 місяців тому

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

    • @PeriMCS
      @PeriMCS 5 місяців тому

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

    • @antonmartyniuk
      @antonmartyniuk 5 місяців тому

      @@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

  • @aweklin
    @aweklin 5 місяців тому

    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?

  • @krccmsitp2884
    @krccmsitp2884 5 місяців тому +1

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

    • @PeriMCS
      @PeriMCS 5 місяців тому

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

    • @meetingattender8132
      @meetingattender8132 4 місяці тому +1

      Do not chose this. Use EF Core migrations.

    • @PeriMCS
      @PeriMCS 4 місяці тому

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

  • @alcoholrelated4529
    @alcoholrelated4529 4 місяці тому

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

  • @evilsquirr3l882
    @evilsquirr3l882 5 місяців тому +1

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

    • @PeriMCS
      @PeriMCS 5 місяців тому +1

      I think it's just Powershell

  • @erikgrundy
    @erikgrundy 5 місяців тому

    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.

  • @DanielOpitz
    @DanielOpitz 5 місяців тому

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

    • @ajdinhusic2574
      @ajdinhusic2574 4 місяці тому

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

    • @DanielOpitz
      @DanielOpitz 4 місяці тому

      @@ajdinhusic2574 This table just marks the migrated versions.

    • @ajdinhusic2574
      @ajdinhusic2574 4 місяці тому

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

  • @michaelkopljan578
    @michaelkopljan578 5 місяців тому +1

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

  • @ArturoNull
    @ArturoNull 5 місяців тому +1

    Thank you!

  • @DaminGamerMC
    @DaminGamerMC 5 місяців тому

    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 5 місяців тому

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

    • @meetingattender8132
      @meetingattender8132 4 місяці тому

      No it's just like __EFMigrationHistory of EF Core

  • @KangasniemiJerri
    @KangasniemiJerri Місяць тому

    Your. Speech. Pattern. Of. Stopping. After. Every. Word. Gets. Very. Tiring. To. Listen. To. After. A. While.

  • @BeyondLegendary
    @BeyondLegendary 5 місяців тому +1

    baldy