johnidm / johnidm/antenna

Sanitize database

Open
#12 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

🧹 Overview

This issue covers a database sanitization pass on the radio stations dataset for Antenna. The goal is to improve data quality by removing unusable entries, normalizing text fields, and adding standard audit/control columns.


💡 Motivation

  • Stations with missing homepages, broken favicons, or unreachable stream endpoints degrade the user experience and waste resources
  • Inconsistent station names and tags (special characters, mixed casing) make search, filtering, and display unreliable
  • Lack of activated, created_at, and updated_at columns makes it impossible to track station lifecycle, audit changes, or selectively enable/disable entries
  • A clean dataset is a prerequisite for features like the station profile page and future recommendations

✅ Acceptance Criteria

Removal — Invalid Stations
  • Remove stations where homepage is null, empty, or malformed
  • Remove stations where favicon is absent or returns a non-2xx response
  • Remove stations where the stream endpoint is unreachable (timeout or non-2xx after N retries)
  • Log removed entries before deletion for audit purposes
Normalization — Names & Tags
  • Strip leading/trailing whitespace from name and tags
  • Remove special characters from name (keep alphanumeric, spaces, hyphens, and ampersands)
  • Normalize tags to lowercase and remove duplicates
  • Trim or collapse multiple consecutive spaces into one
Schema — New Columns
  • Add activated (boolean, default true) — allows soft-disabling a station without deletion
  • Add created_at (timestamp, default now()) — records when the row was inserted
  • Add updated_at (timestamp, default now(), auto-updates on row change) — tracks last modification
  • Write and apply a migration script for the new columns
  • Backfill created_at and updated_at with a reasonable default for existing rows
Validation
  • Run the sanitization on a staging/test database first
  • Confirm row counts before and after removal
  • Verify no valid stations were incorrectly removed

📎 References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the radio stations dataset and the schema or migration entry point; the issue does not name specific files or tests. Review how station records are currently validated and persisted before planning the sanitization pass. Done means the staging run logs removals, normalizes valid records, adds and backfills the lifecycle columns, and verifies before-and-after counts.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data, database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.