User
    ident Text
    name Text Update
    admin Bool default=false
    handle UserHandleT Eq
    email Text Maybe
    url Text Maybe
    bio Textarea Maybe
    UniqueUser ident
    UniqueHandle handle

TFamily
    created UTCTime

Topic
    owner UserId Eq
    title Text Update Asc
    created UTCTime
    family TFamilyId Eq
    allWrite Bool default=false Update Eq

TopicContent
    topic TopicId Eq
    author UserId Eq
    summary Text Maybe
    changed UTCTime Desc
    format TopicFormat
    content Text

TMap
    owner UserId Eq
    title Text Update
    created UTCTime

TMapNode
    map TMapId Eq
    parent TMapNodeId Maybe Eq
    position Int Asc
    ctopic TopicId Maybe Eq Update
    cmap TMapId Maybe Eq
    title Text Maybe
    slug MapNodeSlug
    UniqueMapNode map slug

NewsItem
    created UTCTime Desc
    title Text
    url Text
    content Html
    deriving

Page
    name Text
    topic TopicId Eq
    UniquePage name

Label
    parent LabelId Maybe Eq Update
    name Text

TopicLabel
    topic TopicId Eq
    label LabelId Eq
    UniqueTopicLabel topic label

MapLabel
    map TMapId Eq
    label LabelId Eq
    UniqueMapLabel map label

Blog
    posted UTCTime Desc
    map TMapId Eq
    slug BlogSlugT Eq
    year Int
    month Month
    UniqueBlogSlug year month slug

Book -- singleton
    topic TopicId Maybe Eq
    map TMapId Eq
    chunking Int

StaticContent
    mimetype ByteString
    content ByteString

Comment
    topic TopicId Eq
    element Text Eq
    content TopicId Eq
    time UTCTime Asc

SearchTerm
    topic TopicId Eq
    content Text
    UniqueSearchTerm topic

WikiPage
    name Text
    topic TopicId Eq
    UniqueWikiPage name
