desec-stack
desec-stack copied to clipboard
api: add database trigger to prevent UPDATE on RRset.subname and RRset.type
This is for behind-the-scenes safely only (we have no public interface that allows making these changes).
decorate RRset class with
@pgtrigger.register(
pgtrigger.Protect(
name='protect_updates',
operation=pgtrigger.Update,
condition=pgtrigger.Q(old__subname__df=pgtrigger.F('new__subname'))
| pgtrigger.Q(old__type__df=pgtrigger.F('new__type'))
)
)