Implemented weather stories support
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
// weatherstories_queries.go contains SQL text for weather story reads.
|
||||
// Layer: adapters/outbound/postgres weather stories feature.
|
||||
package postgres
|
||||
|
||||
const (
|
||||
queryLatestWeatherStoryRun = `
|
||||
SELECT
|
||||
event_id,
|
||||
office_id,
|
||||
as_of
|
||||
FROM weather_story_runs
|
||||
ORDER BY as_of DESC, event_emitted_at DESC
|
||||
LIMIT 1`
|
||||
|
||||
queryWeatherStoriesForRun = `
|
||||
SELECT
|
||||
story_index,
|
||||
office_id,
|
||||
start_time,
|
||||
end_time,
|
||||
updated_at,
|
||||
title,
|
||||
description,
|
||||
alt_text,
|
||||
priority,
|
||||
story_order,
|
||||
download_url
|
||||
FROM weather_stories
|
||||
WHERE run_event_id = $1
|
||||
ORDER BY story_index ASC`
|
||||
|
||||
queryLatestWeatherStory = `
|
||||
SELECT
|
||||
story_index,
|
||||
office_id,
|
||||
start_time,
|
||||
end_time,
|
||||
updated_at,
|
||||
title,
|
||||
description,
|
||||
alt_text,
|
||||
priority,
|
||||
story_order,
|
||||
download_url
|
||||
FROM weather_stories
|
||||
ORDER BY updated_at DESC, as_of DESC, story_order ASC, story_index ASC
|
||||
LIMIT 1`
|
||||
)
|
||||
Reference in New Issue
Block a user