domain_id integer default 0,
owner integer default 0,
comment text,
- zone_templ_id integer NOT NULL,
+ zone_templ_id integer NOT NULL default 0,
FOREIGN KEY(domain_id) REFERENCES domains(id),
- FOREIGN KEY(owner) REFERENCES users(id),
- FOREIGN KEY(zone_templ_id) REFERENCES zone_templ(id)
+ FOREIGN KEY(owner) REFERENCES users(id)
);
CREATE INDEX zone_domain_owner ON zones(domain_id, owner);
from .cfg_app import PpCfgAppError, PpConfigApplication
-__version__ = '0.7.4'
+__version__ = '0.7.5'
LOG = logging.getLogger(__name__)
# =============================================================================
'supermasters', 'tsigkeys', 'domains',
]
if self.tgt_db_is_poweradmin:
- tables.insert(0, 'perm_templ_items')
tables.insert(0, 'zone_templ')
tables.insert(0, 'zone_templ_records')
tables.insert(0, 'zones')
'domains_id_seq', 'records_id_seq', 'tsigkeys_id_seq',
]
if self.tgt_db_is_poweradmin:
- sequences.append('perm_templ_items_id_seq')
sequences.append('zone_templ_id_seq')
LOG.info("Truncating all tables in target database ...")
tgt_cursor.execute(sql)
if self.tgt_db_is_poweradmin:
+
+ LOG.debug("Truncating table 'perm_templ_items' ...")
+ sql = "DELETE FROM perm_templ_items WHERE templ_id != 1"
+ if self.verbose > 1:
+ LOG.debug("SQL: {}".format(sql))
+ if not self.simulate:
+ tgt_cursor.execute(sql)
+
LOG.debug("Truncating table 'users' ...")
sql = 'DELETE FROM users WHERE id > 1'
if self.verbose > 1: