diff options
Diffstat (limited to 'lib/Persist.hs')
-rw-r--r-- | lib/Persist.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Persist.hs b/lib/Persist.hs index e73b74f..c44ae3b 100644 --- a/lib/Persist.hs +++ b/lib/Persist.hs @@ -77,10 +77,10 @@ TripPing json sql=tt_trip_ping long Double delay Double timestamp UTCTime - deriving Show Generic Eq + deriving Show Generic Eq ToSchema -- TODO: multi-language support? -Announcement sql=tt_announcements +Announcement json sql=tt_announcements Id UUID default=uuid_generate_v4() trip TripID message Text @@ -88,11 +88,12 @@ Announcement sql=tt_announcements day Day url Text Maybe announcedAt UTCTime Maybe + deriving Generic ToSchema -- | this table works as calendar_dates.txt in GTFS ScheduleAmendment json sql=tt_schedule_amendement trip TripID - day Text + day Day status AmendmentStatus -- only one special rule per TripID and Day (else incoherent) TripAndDay trip day @@ -107,8 +108,6 @@ ExtraordinaryTrip sql=tt_extra_trip instance ToSchema RunningTripId where declareNamedSchema _ = declareNamedSchema (Proxy @UUID) -instance ToSchema TripPing where - declareNamedSchema = genericDeclareNamedSchema (swaggerOptions "ping") runSql :: MonadIO m => Pool SqlBackend -> ReaderT SqlBackend (NoLoggingT (ResourceT IO)) a -> m a runSql pool = liftIO . flip runSqlPersistMPool pool |