mirror of
https://github.com/pschiffe/docker-pdns.git
synced 2024-11-10 18:57:56 +01:00
Include automatic db schema migration to version 4.7
https://doc.powerdns.com/authoritative/upgrading.html#to-4-7-0-or-master fixes #97
This commit is contained in:
parent
0db0e6259e
commit
22d00a3754
1 changed files with 8 additions and 0 deletions
|
@ -53,6 +53,14 @@ if [ "$MYSQL_NUM_TABLE" -eq 0 ]; then
|
||||||
$MYSQL_COMMAND -D "$PDNS_gmysql_dbname" < /usr/share/doc/pdns/schema.mysql.sql
|
$MYSQL_COMMAND -D "$PDNS_gmysql_dbname" < /usr/share/doc/pdns/schema.mysql.sql
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# SQL migration to version 4.7
|
||||||
|
MYSQL_CHECK_IF_47="SELECT COUNT(*) FROM information_schema.columns WHERE table_schema = '${PDNS_gmysql_dbname}' AND table_name = 'domains' AND column_name = 'options';"
|
||||||
|
MYSQL_NUM_TABLE=$($MYSQL_COMMAND --batch --skip-column-names -e "$MYSQL_CHECK_IF_47")
|
||||||
|
if [ "$MYSQL_NUM_TABLE" -eq 0 ]; then
|
||||||
|
echo 'Migrating MySQL schema to version 4.7...'
|
||||||
|
$MYSQL_COMMAND -D "$PDNS_gmysql_dbname" < /usr/share/doc/pdns/4.3.0_to_4.7.0_schema.mysql.sql
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${PDNS_superslave:-no}" == "yes" ]; then
|
if [ "${PDNS_superslave:-no}" == "yes" ]; then
|
||||||
# Configure supermasters if needed
|
# Configure supermasters if needed
|
||||||
if [ "${SUPERMASTER_IPS:-}" ]; then
|
if [ "${SUPERMASTER_IPS:-}" ]; then
|
||||||
|
|
Loading…
Reference in a new issue