import TSN.Picklers ( xp_time_stamp )
import TSN.XmlImport ( XmlImport(..), XmlImportFk(..) )
import Xml (
+ Child(..),
FromXml(..),
FromXmlFk(..),
ToDb(..),
type Db Message = Score
instance FromXml Message where
+ -- | When converting from the XML representation to the database
+ -- one, we drop the list of locations which will be foreign-keyed to
+ -- us instead.
from_xml Message{..} =
Score {
db_xml_file_id = xml_xml_file_id,
--
type Db ScoreGameXml = ScoreGame
-instance FromXmlFk ScoreGameXml where
+
+instance Child ScoreGameXml where
-- | Each 'ScoreGameXml' is contained in (i.e. has a foreign key to)
-- a 'Score'.
--
type Parent ScoreGameXml = Score
+
+instance FromXmlFk ScoreGameXml where
from_xml_fk fk ScoreGameXml{..} =
ScoreGame {
db_scores_id = fk,