Files
ridebus-admin/backend/migrations/008_schedule_imports.sql
Zakhar Timoshenko 595ad6456b feat: add schedule import functionality and quality control page
- Implemented the schedule import feature with a dedicated page for importing schedules from the transport website.
- Added a new QualityPage to check the quality of routes, stops, schedules, and notifications without making automatic changes.
- Created CSS styles for both the ScheduleImportPage and QualityPage to enhance the user interface.
- Introduced API calls for fetching schedule data and quality reports.
- Added error handling and loading states for better user experience during data fetching.
- Included functionality for filtering quality issues and displaying detailed reports.
2026-09-16 21:55:50 +03:00

25 lines
868 B
SQL

-- Import previews are immutable snapshots; applying one is an explicit admin action.
CREATE TABLE IF NOT EXISTS schedule_imports (
id UUID PRIMARY KEY,
route_id INTEGER REFERENCES routes(id) ON DELETE SET NULL,
source_url TEXT NOT NULL,
source_hash TEXT NOT NULL,
source JSONB NOT NULL,
status TEXT NOT NULL CHECK (status IN ('inspection', 'ready', 'applied')),
payload JSONB,
created_by INTEGER,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
applied_at TIMESTAMPTZ
);
CREATE INDEX IF NOT EXISTS idx_schedule_imports_created ON schedule_imports(created_at DESC);
CREATE TABLE IF NOT EXISTS schedule_import_news (
url TEXT PRIMARY KEY,
title TEXT NOT NULL,
published_date TEXT,
content TEXT NOT NULL,
content_hash TEXT NOT NULL,
reviewed_hash TEXT,
checked_at TIMESTAMPTZ NOT NULL DEFAULT now()
);