From 0c6ccdc0a1c6379275f84ca716c874f65e841c57 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Mon, 8 Oct 2018 02:34:03 -0400 Subject: [PATCH] domain_delete.go: delete entries from pages on domain delete --- api/domain_delete.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/domain_delete.go b/api/domain_delete.go index 5b68534..24864bd 100644 --- a/api/domain_delete.go +++ b/api/domain_delete.go @@ -60,6 +60,16 @@ func domainDelete(domain string) error { return errorInternal } + statement = ` + DELETE FROM pages + WHERE pages.domain = $1; + ` + _, err = db.Exec(statement, domain) + if err != nil { + logger.Errorf(statement, domain) + return errorInternal + } + return nil }