User
    handle Slug
    display Text
    token Slug
    UniqueHandle handle
    UniqueToken token
    deriving Typeable

Email
    email Text
    user UserId
    UniqueEmail email

Verkey
    email Text
    verkey Text

Stackage
    user UserId
    ident PackageSetIdent
    uploaded UTCTime
    title Text
    desc Text
    hasHaddocks Bool default=false
    UniqueStackage ident

Uploaded
    name PackageName
    version Version
    uploaded UTCTime
    UniqueUploaded name version

Alias
    user UserId
    name Slug
    target PackageSetIdent
    UniqueAlias user name

Package
    stackage StackageId
    name' PackageName sql=name
    version Version
    overwrite Bool

Download
    ident PackageSetIdent Maybe
    view HackageView Maybe
    timestamp UTCTime
    package PackageName
    version Version
    userAgent Text Maybe

Metadata
    name PackageName
    version Version
    hash ByteString
    deps [Text]
    author Text
    maintainer Text
    licenseName Text
    homepage Text
    bugReports Text
    synopsis Text
    sourceRepo [Text]
    category Text
    library Bool
    exes Int
    testSuites Int
    benchmarks Int

    readme Html
    changelog Html Maybe
    licenseContent Html Maybe

    UniqueMetadata name
