32 lines
937 B
SQL
32 lines
937 B
SQL
CREATE TABLE IF NOT EXISTS maplepress.sites_by_id (
|
|
tenant_id UUID,
|
|
id UUID,
|
|
site_url TEXT,
|
|
domain TEXT,
|
|
api_key_hash TEXT,
|
|
api_key_prefix TEXT,
|
|
api_key_last_four TEXT,
|
|
status TEXT,
|
|
is_verified BOOLEAN,
|
|
verification_token TEXT,
|
|
search_index_name TEXT,
|
|
total_pages_indexed BIGINT,
|
|
last_indexed_at TIMESTAMP,
|
|
plugin_version TEXT,
|
|
-- Usage tracking (for billing) - no limits/quotas
|
|
storage_used_bytes BIGINT,
|
|
search_requests_count BIGINT,
|
|
monthly_pages_indexed BIGINT,
|
|
last_reset_at TIMESTAMP,
|
|
language TEXT,
|
|
timezone TEXT,
|
|
notes TEXT,
|
|
created_at TIMESTAMP,
|
|
updated_at TIMESTAMP,
|
|
-- CWE-359: IP address tracking for GDPR compliance (90-day retention)
|
|
created_from_ip_address TEXT,
|
|
created_from_ip_timestamp TIMESTAMP,
|
|
modified_from_ip_address TEXT,
|
|
modified_from_ip_timestamp TIMESTAMP,
|
|
PRIMARY KEY ((tenant_id, id))
|
|
);
|