Skip to content

Commit

Permalink
Fixed SQL migrations ; Updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
dodancs committed Aug 3, 2024
1 parent b283617 commit 424ac93
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ if [ "${PDNS_gmysql_host:-}" != "" ]; then

SQL_COMMAND="mysql -h ${PDNS_gmysql_host} -P ${PDNS_gmysql_port} -u ${PDNS_gmysql_user} -p${PDNS_gmysql_password} -D ${PDNS_gmysql_dbname}"

# Fix DB schema
sed -i 's/CREATE TABLE/CREATE TABLE IF NOT EXISTS/g ; s/CREATE UNIQUE INDEX/CREATE UNIQUE INDEX IF NOT EXISTS/g ; s/CREATE INDEX/CREATE INDEX IF NOT EXISTS/g' /usr/share/doc/pdns/schema.mysql.sql

# Initialize DB if needed
$SQL_COMMAND </usr/share/doc/pdns/schema.mysql.sql

Expand All @@ -22,9 +19,6 @@ if [ "${PDNS_gpgsql_host:-}" != "" ]; then
export PGPASSWORD=${PDNS_gpgsql_password}
SQL_COMMAND="psql -h ${PDNS_gpgsql_host} -p ${PDNS_gpgsql_port} -U ${PDNS_gpgsql_user} -w ${PDNS_gpgsql_dbname}"

# Fix DB schema
sed -i 's/CREATE TABLE/CREATE TABLE IF NOT EXISTS/g ; s/CREATE UNIQUE INDEX/CREATE UNIQUE INDEX IF NOT EXISTS/g ; s/CREATE INDEX/CREATE INDEX IF NOT EXISTS/g' /usr/share/doc/pdns/schema.pgsql.sql

# Initialize DB
$SQL_COMMAND </usr/share/doc/pdns/schema.pgsql.sql

Expand Down

0 comments on commit 424ac93

Please sign in to comment.