Implemented NWS weather stories support
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-05-30 06:47:18 -05:00
parent cca873cafb
commit fd820fd964
19 changed files with 931 additions and 11 deletions

View File

@@ -11,6 +11,8 @@ const (
tableForecastPeriods = "forecast_periods"
tableForecastDiscussions = "forecast_discussions"
tableForecastDiscussionKeyMessages = "forecast_discussion_key_messages"
tableWeatherStoryRuns = "weather_story_runs"
tableWeatherStories = "weather_stories"
tableAlertRuns = "alert_runs"
tableAlerts = "alerts"
tableAlertReferences = "alert_references"
@@ -174,6 +176,51 @@ func PostgresSchema() fksinks.PostgresSchema {
{Name: "idx_wf_discussion_message_issued_at", Columns: []string{"issued_at"}},
},
},
{
Name: tableWeatherStoryRuns,
Columns: []fksinks.PostgresColumn{
{Name: "event_id", Type: "TEXT", Nullable: false},
{Name: "event_kind", Type: "TEXT", Nullable: false},
{Name: "event_source", Type: "TEXT", Nullable: false},
{Name: "event_schema", Type: "TEXT", Nullable: false},
{Name: "event_emitted_at", Type: "TIMESTAMPTZ", Nullable: false},
{Name: "event_effective_at", Type: "TIMESTAMPTZ", Nullable: true},
{Name: "office_id", Type: "TEXT", Nullable: true},
{Name: "as_of", Type: "TIMESTAMPTZ", Nullable: false},
{Name: "story_count", Type: "INTEGER", Nullable: false},
},
PrimaryKey: []string{"event_id"},
PruneColumn: "as_of",
Indexes: []fksinks.PostgresIndex{
{Name: "idx_wf_story_run_office_as_of", Columns: []string{"office_id", "as_of"}},
{Name: "idx_wf_story_run_as_of", Columns: []string{"as_of"}},
},
},
{
Name: tableWeatherStories,
Columns: []fksinks.PostgresColumn{
{Name: "run_event_id", Type: "TEXT REFERENCES weather_story_runs(event_id) ON DELETE CASCADE", Nullable: false},
{Name: "story_index", Type: "INTEGER", Nullable: false},
{Name: "as_of", Type: "TIMESTAMPTZ", Nullable: false},
{Name: "office_id", Type: "TEXT", Nullable: true},
{Name: "start_time", Type: "TIMESTAMPTZ", Nullable: false},
{Name: "end_time", Type: "TIMESTAMPTZ", Nullable: false},
{Name: "updated_at", Type: "TIMESTAMPTZ", Nullable: false},
{Name: "title", Type: "TEXT", Nullable: true},
{Name: "description", Type: "TEXT", Nullable: true},
{Name: "alt_text", Type: "TEXT", Nullable: true},
{Name: "priority", Type: "BOOLEAN", Nullable: false},
{Name: "story_order", Type: "INTEGER", Nullable: false},
{Name: "download_url", Type: "TEXT", Nullable: true},
},
PrimaryKey: []string{"run_event_id", "story_index"},
PruneColumn: "as_of",
Indexes: []fksinks.PostgresIndex{
{Name: "idx_wf_stories_start_time", Columns: []string{"start_time"}},
{Name: "idx_wf_stories_end_time", Columns: []string{"end_time"}},
{Name: "idx_wf_stories_updated_at", Columns: []string{"updated_at"}},
},
},
{
Name: tableAlertRuns,
Columns: []fksinks.PostgresColumn{