Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Fixed issues with hibp tables
Browse files Browse the repository at this point in the history
removed duplicate column and fixed relationship in the view
  • Loading branch information
DJensen94 committed Oct 4, 2021
1 parent 2b6c875 commit 6b2eb7f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pe_reports/data/data_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ CREATE TABLE IF NOT EXISTS public.shodan_assets
CREATE TABLE IF NOT EXISTS public.hibp_breaches
(
hibp_breaches_uid uuid default uuid_generate_v1() NOT NULL,
breach_id uuid NOT NULL,
breach_name text NOT NULL,
description text,
exposed_cred_count bigint,
Expand All @@ -229,6 +228,7 @@ CREATE TABLE IF NOT EXISTS public.hibp_breaches
is_sensitive boolean,
is_retired boolean,
is_spam_list boolean,
UNIQUE (breach_name)
PRIMARY KEY (hibp_breaches_uid)
);

Expand All @@ -240,6 +240,7 @@ CREATE TABLE IF NOT EXISTS public.hibp_exposed_credentials
organizations_uid uuid NOT NULL,
root_domain text,
sub_domain text,
modified_date timestamp without time zone,
breach_name text,
breach_id uuid NOT NULL,
UNIQUE (email, breach_name),
Expand Down Expand Up @@ -379,6 +380,6 @@ SELECT creds.hibp_exposed_credentials_uid,creds.email, creds.breach_name, creds.
FROM hibp_exposed_credentials as creds

JOIN hibp_breaches as b
ON creds.breach_id = b.breach_id;
ON creds.breach_id = b.hibp_breaches_uid;

END;

0 comments on commit 6b2eb7f

Please sign in to comment.