In Depth Entity Framework Migrations with Postgres

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024
  • Learn how to use Entity Framework Migrations in .Net 7. I go over how to create migrations, remove migrations, apply migrations to the database, and revert migrations.
    Also see how to update the database using two alternative methods, generating a sql script, and generating a bundle.
    dotnet ef cli tools reference:
    learn.microsof...
    EF Migrations overview. This whole docs section is a great reference to a lot of the commands I used in this video:
    learn.microsof...
    EF Core Nuget package for Postgres
    www.nuget.org/...
    Follow me on social media!
    Twitter: / scriptbytesio
    Instagram: / scriptbytes

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

  • @umeshdissanayaka2802
    @umeshdissanayaka2802 4 дня назад

    Superb Nice Explanation

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

    Great! Thanks! Just started looking at PostgreSQL as an alternative to SQL Server

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

    Great Work!, You don't know how much this video tutorial has helped me to understand the Migrations Topic Keep the good work!

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

      I appreciate it! I’m glad the video helped! Thanks for watching.

  • @s0ft466
    @s0ft466 7 месяцев назад +1

    Phenomenally explained! Thank you! Please make more videos, regarding other Postgres features that EF Migrations can handle (can it do triggers and storedprocs?)

    • @scriptbytes
      @scriptbytes  7 месяцев назад +1

      Thank you. I may be doing more in the future, but yes, you can script things like stored procedures. Look into the MigrationBuilder.Sql(...) method. It allows you to run sql, which you can use to run your 'create procedure' scripts.

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

    Great high quality explanation. Thanks!

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

      You’re welcome, thanks for watching!

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

    Thanks for the Video very good explanation !

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

    Exceptional work! Thank you!!

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

    Awesome video. Learnt so much :)

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

    Amazing! Thanks and Congrats...

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

    Saved my day!

  • @marcturelles7684
    @marcturelles7684 9 месяцев назад

    Fantastic video

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

    hi, i have some issue when i migrated with enum data type, inside my db it should be enum instead of int do you know how to fix that?

  • @MyPlaylist-xq8en
    @MyPlaylist-xq8en 9 месяцев назад

    awesome guide!

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

    It was an amazing migrations tutorial. Could you please make a tutorial for how to seed in a table? looking forward to seeing it. thanks again

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

      That’s a great idea. I’ll add it to my list.
      Thanks for watching!

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

      I put out a video today on seeding data. Let me know what you think!

  • @safyan_yaqoob
    @safyan_yaqoob 9 месяцев назад

    Thanks for sharing

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

    This was incredibly helpful, thank you so much!

  • @saifumar3001
    @saifumar3001 4 месяца назад

    Scripts @ 23:32 with -o and idempotent switch

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

    hello I faced to this error how to fix
    dotnet ef migrations add initialMigration
    Could not execute because the specified command or file was not found.
    Possible reasons for this include:
    * You misspelled a built-in dotnet command.
    * You intended to execute a .NET program, but dotnet-ef does not exist.
    * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

  • @adam-xt8te
    @adam-xt8te 7 месяцев назад

    Do you run postgresql on production server as linux daemon or docker container?

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

      It all depends on what you're comfortable with. I enjoy docker because it's easy to stand up a database with it.
      For production, depending on the size and demand, it might be worth looking into a service like Cloud SQL to host the DB as well.

    • @adam-xt8te
      @adam-xt8te 7 месяцев назад

      @@scriptbytes Is there a huge difference in performance and resource draining in these two approaches?

    • @scriptbytes
      @scriptbytes  7 месяцев назад +1

      @@adam-xt8te I don't have enough experience with both to know if there's much of a difference.
      However from what I've seen from benchmark results, there's little to no difference between docker and native run postgres DB's. Not enough to matter for the vast majority of use cases anyways.

  • @amnashahid9464
    @amnashahid9464 4 месяца назад

    how to call sp in PostgreSQL that returns rows ?

    • @scriptbytes
      @scriptbytes  4 месяца назад

      You would probably want to use FromSql:
      learn.microsoft.com/en-us/ef/core/querying/sql-queries

    • @amnashahid9464
      @amnashahid9464 4 месяца назад

      @@scriptbytes thanks for ur reply. Actually I did use it. But in postgresql, if ur sp returns rows it has to have a refcursor which will contain rows and when u call sp from c# u need to run call ur_sp(params, 'cur'); fetch all in "cur". So this command not working if we use ef