Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Tracking and deploying changes in (MySql/Maria) DB schema ...

by holli (Abbot)
on May 22, 2019 at 21:11 UTC ( [id://11100389]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11100389]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found