nordabiz/database/migrations/077_portal_seo_audits.sql
Maciej Pienczyn dd4ab4c9fc
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
feat: portal self-audit SEO dashboard with history tracking
Add /admin/portal-seo to run SEO audits on nordabiznes.pl
using the same SEOAuditor used for company websites.
Tracks results over time for before/after comparison.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:15:33 +01:00

57 lines
1.5 KiB
SQL

-- Portal SEO Self-Audit History
-- Tracks SEO audit results for nordabiznes.pl over time
CREATE TABLE IF NOT EXISTS portal_seo_audits (
id SERIAL PRIMARY KEY,
audited_at TIMESTAMP NOT NULL DEFAULT NOW(),
url VARCHAR(500) NOT NULL DEFAULT 'https://nordabiznes.pl',
-- PageSpeed Insights scores (0-100)
pagespeed_performance INTEGER,
pagespeed_seo INTEGER,
pagespeed_accessibility INTEGER,
pagespeed_best_practices INTEGER,
-- Core Web Vitals
lcp_ms NUMERIC(10,2),
fcp_ms NUMERIC(10,2),
cls NUMERIC(6,4),
tbt_ms NUMERIC(10,2),
speed_index_ms NUMERIC(10,2),
-- On-page SEO checks
has_meta_title BOOLEAN,
has_meta_description BOOLEAN,
has_canonical BOOLEAN,
has_robots_txt BOOLEAN,
has_sitemap BOOLEAN,
has_structured_data BOOLEAN,
has_og_tags BOOLEAN,
has_ssl BOOLEAN,
is_mobile_friendly BOOLEAN,
-- Security headers
has_hsts BOOLEAN,
has_csp BOOLEAN,
has_x_frame BOOLEAN,
has_x_content_type BOOLEAN,
-- Content metrics
page_size_bytes INTEGER,
image_count INTEGER,
images_without_alt INTEGER,
-- Full audit data (JSON blob for details)
full_results JSONB,
-- Notes
notes TEXT,
created_by VARCHAR(100)
);
-- Index for time-series queries
CREATE INDEX IF NOT EXISTS idx_portal_seo_audits_date ON portal_seo_audits(audited_at DESC);
-- Grant permissions
GRANT ALL ON TABLE portal_seo_audits TO nordabiz_app;
GRANT USAGE, SELECT ON SEQUENCE portal_seo_audits_id_seq TO nordabiz_app;