Using Git to track mysql schema - some questions

后端 未结 8 2035
忘掉有多难
忘掉有多难 2020-12-04 10:27

If this is recommended ?

Can I ask some git command examples about how to track versions of mysql schema?

Should we use another repository other then the on

8条回答
  •  时光取名叫无心
    2020-12-04 10:50

    I have found the following options to be mandatory for a version control / git-compatible mysqldump.

    mysqldump --skip-opt --skip-comments |sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/'
    

    (and maybe --no-data)

    --skip-opt is very useful, it takes away all of --add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset. The DEFINER sed is necessary when the database contains triggers.

提交回复
热议问题