From 50c435c0564dd9f6393b4dbbb1d86a7236832dc8 Mon Sep 17 00:00:00 2001 From: Endre Karlson Date: Tue, 31 Mar 2015 14:05:25 +0200 Subject: [PATCH] Fix support for PostgreSQL https://review.openstack.org/152337 - This is a reference for dropping support for downgrade() in migrations that add values to enums since it's hard to delete values from a enum type in postgres. Change-Id: I61e86935b508986470447f02fa2f4b6c9d9f8afd --- .../lib/designate_plugins/backend-powerdns | 30 ++++++- .../010_records_add_disabled_column.py | 6 +- .../versions/039_support_soa_records.py | 63 +++------------ .../043_modify_domains_and_records.py | 80 +++++++++---------- ...048_add_zone_ownership_transfers_tables.py | 7 +- .../migrate_repo/versions/051_scoped_tsig.py | 8 +- .../versions/052_secondary_zones.py | 56 +++++++------ .../versions/054_allow_duplicate_domains.py | 2 + 8 files changed, 126 insertions(+), 126 deletions(-) diff --git a/contrib/devstack/lib/designate_plugins/backend-powerdns b/contrib/devstack/lib/designate_plugins/backend-powerdns index cf99ad17..3b26ec61 100644 --- a/contrib/devstack/lib/designate_plugins/backend-powerdns +++ b/contrib/devstack/lib/designate_plugins/backend-powerdns @@ -40,7 +40,15 @@ function install_designate_backend { PDNS=pdns-server fi - install_package $PDNS pdns-backend-mysql + if is_service_enabled mysql; then + PDNS+=" pdns-backend-mysql" + elif is_service_enabled postgresql; then + PDNS+=" pdns-backend-pgsql" + else + die $LINENO "PowerDNS backend only supports MySQL / PostgreSQL" + fi + + install_package $PDNS sudo rm -rf $POWERDNS_CFG_DIR/pdns.d } @@ -84,9 +92,21 @@ gmysql-user=$DATABASE_USER gmysql-password=$DATABASE_PASSWORD gmysql-dbname=designate_pdns gmysql-dnssec=yes +EOF + elif is_service_enabled postgresql; then + sudo tee -a $POWERDNS_CFG_DIR/pdns.conf > /dev/null <