Spring Boot Database Migrations with Flyway -Example | Java Techie

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

КОМЕНТАРІ • 89

  • @manirsg9641
    @manirsg9641 5 років тому +4

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

  • @vaibhav1003
    @vaibhav1003 10 місяців тому +2

    Excellent Video!

  • @programmingwithnish483
    @programmingwithnish483 Рік тому

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

  • @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."

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

  • @hkmehandiratta
    @hkmehandiratta Рік тому +1

    As always awesome. Thanks for sharing.

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

  • @buildbottech
    @buildbottech 8 місяців тому

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

  • @euivanw
    @euivanw 4 роки тому +3

    Thanks for sharing your knowledge with us!!

  • @GuitarreroDaniel
    @GuitarreroDaniel 4 роки тому +5

    Great tutorial man, thank your very much!

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

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

    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

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

  • @naganeelima7992
    @naganeelima7992 9 днів тому

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

  • @girishrp9339
    @girishrp9339 9 місяців тому +1

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

    • @Javatechie
      @Javatechie  9 місяців тому

      Noted . Will plan it

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

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

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

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

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

  • @Abitgenius
    @Abitgenius 4 роки тому +1

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

  • @rajeshbongurala8491
    @rajeshbongurala8491 Рік тому

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

  • @draganpajic3511
    @draganpajic3511 3 роки тому +1

    Excellent!

  • @unemployedcse3514
    @unemployedcse3514 2 роки тому +1

    Awesome ❤️

  • @pabloezequielsantiagorecag5015
    @pabloezequielsantiagorecag5015 4 роки тому +2

    Nice video!.Helped me a lot!.

  • @sreekanth6618
    @sreekanth6618 2 роки тому +1

    tq very much finally i did

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

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

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

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

  • @Das.Kleine.Krokodil
    @Das.Kleine.Krokodil 2 роки тому

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

  • @kadir4255
    @kadir4255 2 роки тому

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

  • @Das.Kleine.Krokodil
    @Das.Kleine.Krokodil 2 роки тому +1

    Thanks

  • @zimisdev1199
    @zimisdev1199 4 роки тому +9

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

  • @lts8683
    @lts8683 2 роки тому +1

    thanks you

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

  • @AninditaSarkar-yl2qt
    @AninditaSarkar-yl2qt Рік тому

    thankyou so much

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

    perfect

  • @josephselvaraj8359
    @josephselvaraj8359 4 роки тому

    Nice one , Great

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

  • @balaveeraraghavareddy9764
    @balaveeraraghavareddy9764 4 роки тому +1

    Thanks a lot

  • @amaradhipadmaja9232
    @amaradhipadmaja9232 4 роки тому

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

  • @Pain-qu5nr
    @Pain-qu5nr Рік тому

    How to config the flyway in yml?

  • @abhinayneekhra4230
    @abhinayneekhra4230 4 роки тому

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

  • @tusharrebaca
    @tusharrebaca 3 роки тому

    How to handle table association with flyway?

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

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