Spring Boot Database Migrations with Flyway -Example | Java Techie

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

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

  • @sarojsahoo8763
    @sarojsahoo8763 4 года назад +5

    Also Please explain in terms of Different Evironemnts like dev,qa,stage,prod ------ Suppose some database related changes has been recently pushed to dev branch from local . QA's are still not able to see the new table changes . Whatever changes I did in my local should also be available in dev , qa , stage as code gets pushed to respective environments. So Once code gets pushed to qa env they should be able to see the changes which is being taken care by flyway.

  • @Das.Kleine.Krokodil
    @Das.Kleine.Krokodil 2 года назад +2

    Thank you. I would like to emphasize that there must be two underscores in the file name, otherwise there will be an error "SQL migrations were detected but not run because they did not follow the filename convention."

  • @vaibhav1003
    @vaibhav1003 11 месяцев назад +2

    Excellent Video!

  • @manirsg9641
    @manirsg9641 5 лет назад +4

    Great...ofcous, we r using it in the current working project.

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

    As always awesome. Thanks for sharing.

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

    I don't think we need entities to be defined in order to manage/migrate the changes.... all you need to have is properties defined in application.properties and the sql script... It will auto migrate...

  • @Manikandan-nn2bw
    @Manikandan-nn2bw Год назад +1

    Thank you so much brother! It is really helpful.

  • @c0mpuipf
    @c0mpuipf 2 года назад +1

    this was a very good tutorial, thanks for the help

  • @euivanw
    @euivanw 4 года назад +3

    Thanks for sharing your knowledge with us!!

  • @GuitarreroDaniel
    @GuitarreroDaniel 4 года назад +5

    Great tutorial man, thank your very much!

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

    Thanks for watching this video? Thanks for sharing this video, more like it! Thanks buddy!

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

    so is there like we can also go back to the previous version of db? like we do in git just go back to prev version of project in case you did some mistake

  • @datturao8689
    @datturao8689 10 месяцев назад +1

    Thank you for the detailed explanation. Will this flyway supports plsql queries also, I mean if i have sql file as combination of sql and plsql scripts then can we do this with Flyway?

  • @girishrp9339
    @girishrp9339 10 месяцев назад +1

    Please make one video for how insert and retrieve data from snowflake database. Currently trending and entire RUclips no one done proper connection.

    • @Javatechie
      @Javatechie  10 месяцев назад

      Noted . Will plan it

  • @pabloezequielsantiagorecag5015
    @pabloezequielsantiagorecag5015 4 года назад +2

    Nice video!.Helped me a lot!.

  • @ShivamKendre-fc3su
    @ShivamKendre-fc3su 9 дней назад

    Great video

  • @BINAYKUMAR-bs6ev
    @BINAYKUMAR-bs6ev Год назад +1

    But why do we have to insert the sql command for all changes?? Repository does that automatically right?

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

      No it won't we are doing it for audit purposes as well

  • @rajansonvane488
    @rajansonvane488 2 года назад +1

    One question
    We can also do this with git. We can use an SQL file and commit every time changes are done. With this new joiner can know who made what changes and when? Please help me to understand

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

      If you will use git then it requires users manual intervention isn't it. It won't help for auditing

  • @anandjaisy
    @anandjaisy 4 года назад +3

    Hi, thank you for the demo it's really helpful. I have one question should isn't a migration project should be a sub-module project of main project, and run the migration using the cmd script so that the migration code doesn't run everytime. It should be execute when we want to run the migration. If so how can we do this can you please explain in details.

    • @Javatechie
      @Javatechie  4 года назад

      In Maven multi module project You want to perform db migration using query and expecting it to run once ?
      Did I understand your requirement correctly?

    • @anandjaisy
      @anandjaisy 4 года назад

      @@Javatechie Yes

    • @Javatechie
      @Javatechie  4 года назад

      Yup same concept I saw as part of my project I will check and update

    • @anandjaisy
      @anandjaisy 4 года назад +1

      @@Javatechie Do you have any video communicating among microservices using apache Kafka pop and subscribe

    • @Javatechie
      @Javatechie  4 года назад

      Not exactly but you can check out spring cloud stream tutorial once .

  • @mohd.faizan3003
    @mohd.faizan3003 3 года назад +2

    Great tutorial man but I am facing an issue that migrations are not applied .
    Giving:No migrations found .Are your locations set up correctly ?

  • @Abitgenius
    @Abitgenius 4 года назад +1

    Is it possible to downgrade to lower versions? and naming convention can be changed?

  • @skullwise
    @skullwise 4 года назад +2

    Thanks. You explained the concept extremely well. I have a question though. Why don't we have just one V1_SQL file and make changes to the same file whenever there is a change request. We can check-in the file in GIT thereby we can also keep track of how the tables have changed. Why maintain multiple versions(V1, V2 etc) of sql file?

    • @Javatechie
      @Javatechie  4 года назад +2

      No it's good to have multiple version , it will easy for developer to find out latest changes .
      Yes we can do change in single yile

    • @skullwise
      @skullwise 4 года назад +1

      @@Javatechie Thanks a lot, buddy

    • @fatihsonmez
      @fatihsonmez 3 года назад +1

      if you have a multiple change, instead of adding something new to the old file and making it longer, you just add another property to new file. easy to read, easy to maintain. just like having different css, js and html files. you can just put all of em into one html file but is this the right way?

    • @Javatechie
      @Javatechie  3 года назад +1

      Just create a file with latest version number.

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

    Can we change the existing table name without creating a new table using this flyway migration tool ?

  • @draganpajic3511
    @draganpajic3511 3 года назад +1

    Excellent!

  • @MayureshDiaries
    @MayureshDiaries 6 месяцев назад +1

    Does flyway also validate table schema against entity?

    • @Javatechie
      @Javatechie  6 месяцев назад +1

      Yes it do

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

      @@Javatechie can you elaborate it more with explanation?

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

    Can we do it without restart of service? like when ever a file getz added automatically flyway should pickup and execute..

  • @burepallichandra
    @burepallichandra 4 года назад +1

    Hi,
    I have one question here why they given name as "Migration"?. Migration has different meaning right -migration mean from one framework to another (oracle to mysql example). Does it flyway migration or flyway version control?

    • @Javatechie
      @Javatechie  4 года назад

      No it is DB migration and flyway version control the reason they named it migration I believe as indicate version migration

  • @bunnihilator
    @bunnihilator 2 года назад +1

    very good

  • @amitsinha7499
    @amitsinha7499 4 года назад +1

    How we can pass parameterize schemes during deployment?

    • @Javatechie
      @Javatechie  4 года назад

      Amit didn't get you

    • @1hindu-sthaani558
      @1hindu-sthaani558 3 года назад

      You can use schema name in db connection it will use that as default schema for your database whatever schema you want to use.
      Flyway auto handling it's tracking in one table in same schema
      Am I got your question right way?

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

    I am getting this error : Caused by: java.sql.SQLException: Cannot proceed, because event scheduler is disabled

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

    How can I redeploy same script again (for ex V1__db script.sql need to deployed again)?

  • @sreekanth6618
    @sreekanth6618 2 года назад +1

    tq very much finally i did

  • @zimisdev1199
    @zimisdev1199 4 года назад +9

    Смотреть без звука

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

    Please make vedio on how to deploy spring boot application with MySQL database containing (entities) to Google cloud platform.Is this flyway will help me to save the database of MySQL to the cloud SQL ??? Please reply n make vedio on this

  • @skipa9906
    @skipa9906 2 года назад +1

    Hi, can I have to data sources? one as a source and the other as target? how can I do this, do you have demo? thank you

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

      Didn't get your question

    • @skipa9906
      @skipa9906 2 года назад +1

      @@Javatechie I'm asking if it's possible to do a migration by connecting two databases. Database A is the source and Database B as the target.

    • @Javatechie
      @Javatechie  2 года назад +1

      No it's not possible using this

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

      @@Javatechie okay, thank you

  • @amaradhipadmaja9232
    @amaradhipadmaja9232 4 года назад

    When i added Flyway it dint build db file in srs/main folder,. Why is it so ?

  • @JulianLuis89
    @JulianLuis89 5 лет назад +1

    Great video! Dont we need to use flyway maven plugin? Tks

    • @Javatechie
      @Javatechie  5 лет назад

      Not required if you are using spring Boot

  • @abhinayneekhra4230
    @abhinayneekhra4230 4 года назад

    After adding licensed key getting error like flywayException :. missing License key kindly help me

  • @unemployedcse3514
    @unemployedcse3514 2 года назад +1

    Awesome ❤️

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

    NICE VIDEO ♥♥♥ Excuse the question, it is the first api I am making. Is the database created automatically? Or we can add a file to "migration" with the name "V1__CreateDb". If it can be created, what command do you use to create it?

    • @Javatechie
      @Javatechie  3 года назад +1

      As I enable hbm2.ddl.auto , jpa will create table for us but if you want you can add a SQL script under resources folder . Either way you can try

  • @Das.Kleine.Krokodil
    @Das.Kleine.Krokodil 2 года назад

    What is *baseline-on-migrate=true* for here?

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

    How to handle table association with flyway?

  • @josephselvaraj8359
    @josephselvaraj8359 4 года назад

    Nice one , Great

  • @abhinayneekhra4230
    @abhinayneekhra4230 4 года назад +1

    I am not able to use flyway license

    • @Javatechie
      @Javatechie  4 года назад

      What is the problem? Any error ?

  • @teklehaimanotatikilt1435
    @teklehaimanotatikilt1435 5 лет назад

    how to store fingerprint to database using spring boot?

  • @Pain-qu5nr
    @Pain-qu5nr 2 года назад

    How to config the flyway in yml?

  • @Das.Kleine.Krokodil
    @Das.Kleine.Krokodil 2 года назад +1

    Thanks

  • @AninditaSarkar-yl2qt
    @AninditaSarkar-yl2qt Год назад

    thankyou so much

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

    perfect

  • @xyz-114-78
    @xyz-114-78 5 лет назад +1

    Hi Basant Bro, This is Awesome video for Database Migration.
    My question is how to identify which user was modified in DB in past? How to keep on track on FlyWay?

    • @sarojsahoo8763
      @sarojsahoo8763 5 лет назад +1

      I think it should be under installedBy like in this example it is root.

    • @Javatechie
      @Javatechie  5 лет назад

      Hi Mukesh good question , I will check it and update here

    • @xyz-114-78
      @xyz-114-78 5 лет назад +1

      @@Javatechie Thank you Basant Bhai

  • @lts8683
    @lts8683 2 года назад +1

    thanks you

  • @balaveeraraghavareddy9764
    @balaveeraraghavareddy9764 4 года назад +1

    Thanks a lot

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

    learn to speak english if you want your channel to have more views

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

      @@ia5687 you think that cuz you probably speak the same english as him, but if you watch a channel like Java Brains you will see what understandable english sounds like.

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

      @@ia5687 i did not say anything about the value of the tutorial, for people that understand it its probably good, but i can guarantee there are alot of people that struggle with this english, did not want to be mean but it is what it is.

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

      Kristiyan i didn't get this kind of comment before about English. it would be easy for you to understand if you can enable subtitles also I will take this point further to improve my communication. @Idress calm down buddy everyone has their own opinion I am really happy that you like my content and support me .

    • @kristiyanzlatkovski1001
      @kristiyanzlatkovski1001 2 года назад +1

      @@Javatechie yeah sry i could have worded it nicer, its my fault he reacted so strong.

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

    Great tutorial man but I am facing an issue that migrations are not applied .
    Giving:No migrations found .Are your locations set up correctly ?