From: Michael Tremer Date: Tue, 6 Jan 2026 11:25:12 +0000 (+0000) Subject: sources: Initialize all stats with zero X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb64794f25b95bde252e23c11f63874c4c3a7db7;p=dbl.git sources: Initialize all stats with zero Signed-off-by: Michael Tremer --- diff --git a/src/database.sql b/src/database.sql index f167e94..be5db53 100644 --- a/src/database.sql +++ b/src/database.sql @@ -2,7 +2,7 @@ -- PostgreSQL database dump -- -\restrict ojEgXNAwBkGyL3RsBRmmfNIe4rzZCESF05HETamfMJWgxDjOkXoCxupLP3Ug6qU +\restrict 0x0tldyHgIUyWxgnGUGi115yWYckW02ZTvAqVYxdprpqc4kMhzpMBPkpIKiHQLO -- Dumped from database version 17.6 (Debian 17.6-0+deb13u1) -- Dumped by pg_dump version 17.6 (Debian 17.6-0+deb13u1) @@ -281,8 +281,8 @@ CREATE TABLE public.sources ( last_modified_at timestamp with time zone, etag text, updated_at timestamp with time zone, - total_domains integer, - dead_domains integer, + total_domains integer DEFAULT 0, + dead_domains integer DEFAULT 0, false_positives integer DEFAULT 0 NOT NULL ); @@ -587,5 +587,5 @@ ALTER TABLE ONLY public.sources -- PostgreSQL database dump complete -- -\unrestrict ojEgXNAwBkGyL3RsBRmmfNIe4rzZCESF05HETamfMJWgxDjOkXoCxupLP3Ug6qU +\unrestrict 0x0tldyHgIUyWxgnGUGi115yWYckW02ZTvAqVYxdprpqc4kMhzpMBPkpIKiHQLO diff --git a/src/dnsbl/sources.py b/src/dnsbl/sources.py index ea4024d..d981f0e 100644 --- a/src/dnsbl/sources.py +++ b/src/dnsbl/sources.py @@ -597,9 +597,9 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True): # Stats - total_domains : int | None + total_domains: int = 0 - dead_domains : int | None + dead_domains: int = 0 false_positives: int = 0