in reply to Re: Tracking and deploying changes in (MySql/Maria) DB schema ...
in thread Tracking and deploying changes in (MySql/Maria) DB schema ...

That's probably the simplest way. mysqldump --no-data -u someuser -p mydatabase > current.sql and then diff it to howitshouldbe.sql created in the same manner.


holli

You can lead your users to water, but alas, you cannot drown them.

Replies are listed 'Best First'.
Re^3: Tracking and deploying changes in (MySql/Maria) DB schema ...
by LanX (Saint) on May 22, 2019 at 22:55 UTC
    Maybe I should have been more explicit about needing the incremental steps (i.e. ALTER TABLEs) and not just a diff between states.

    Thought it's obviously better done this way. ( and easier documented)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      my crazy idea: Have a cron job doing hourly (or so)
      mysqldump ... git commit ...
      If the cron job is scheduled often enough, it would register the modifications with enough granularity.

        This is not crazy. It works. We did it like this with a huge MySQL DB for about 10 years. Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

        This looks good, will try it out, thanks! :)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice