Skip to content
This repository was archived by the owner on Aug 6, 2022. It is now read-only.

IV. Database schema

Andrey Bogdanov edited this page Mar 2, 2016 · 26 revisions

Schema

postCounters

Post counters for each board.

Type: hash.

Key: board name.

Value: last post number on the board.

threads:<boardName>

Thread information for each thread on each board.

Type: multiple hashes. <boardName> is the additional part of the key.

Key: thread number.

Value: Stringified JSON. Fields:

  • archived Determines if the thread is archived. Must be false.
  • boardName The thread's board name.
  • closed Determines if the thread is closed. Possible values: true/false.
  • createdAt Thread creation date and time in ISO format.
  • fixed Determines if the thread is fixed. Possible values: true/false.
  • number The number of the thread.
  • user Thread author information. An object.
  • hashpass User hashpass (hex representation of a SHA-1 hash). May be null.
  • ip IP-address of the user in normalized IPv6 form.
  • level User access level. "SUPERUSER", "ADMIN", "MODER", "USER", or null.
  • password Hashed (SHA-1) user password. May be null.
  • unbumpable Determines if the thread is unbumpable. Possible values: true/false`.
archivedThreads:<boardName>

Archived thread information for each archived thread on each board.

Type: multiple hashes. <boardName> is the additional part of the key.

Key: thread number.

Value: Stringified JSON. Fields:

  • archived Determines if the thread is archived. Must be true.
  • boardName The thread's board name.
  • closed Determines if the thread is closed. Possible values: true/false.
  • createdAt Thread creation date and time in ISO format.
  • fixed Determines if the thread is fixed. Possible values: true/false.
  • number The number of the thread.
  • user Thread author information. An object.
  • hashpass User hashpass (hex representation of a SHA-1 hash). May be null.
  • ip IP-address of the user in normalized IPv6 form.
  • level User access level. "SUPERUSER", "ADMIN", "MODER", "USER", or null.
  • password Hashed (SHA-1) user password. May be null.
  • unbumpable Determines if the thread is unbumpable. Possible values: true/false`.
threadUpdateTimes:<boardName>

Last thread update time for each thread (both archived and not archived) on each board. Hint: A thread is updated on new post if it has not reached the bump limit.

Type: multiple hashes. <boardName> is the additional part of the key.

Key: thread number.

Value: Thread last update date and time in ISO format.

threadPostNumbers:<boardName>:<threadNumber>

A list of post numbers for each thread (both archived and not archived) on each board.

Type: multiple unordered sets. <boardName> and <threadNumber> are the additional parts of the key.

Values: Numbers of the posts in the thread.

threadsPlannedForDeletion

A list of threads planned for deletion on each board. Note: Used for debug and error recovery if thread deletion fails.

Type: Unordered set.

Values: A combination of thread board name and number separated by a semicolon (<boardName>:<threadNumber>).

posts

Post map for each thread (both archived and not archived) on each board.

Type: Hash.

Key: A combination of post board name and number separated by a semicolon (<boardName>:<postNumber>).

Value: Stringified JSON. Fields:

  • boardName The post's board name.
  • createdAt Post creation date and time in ISO format.
  • email Post author email. A string or null.
  • geolocation Post author geolocation data. An object.
  • cityName Identified city name. May be null.
  • countryCode Identified country code. May be null.
  • countryName Identified country name. May be null.
  • markup An Array of markup modes applied to the post text. May contain "EXTENDED_WAKABA_MARK" and/or "BB_CODE".
  • name Post author name. A string or null.
  • number The number of the post.
  • options Post options. An object.
  • showTripcode Determines if a tripcode is to be shown for the post. May be true or false.
  • signAsOp Determines whether the post is marked to have the "OP" sign. May be true or false.
  • rawText Raw post text. A string or null.
  • subject Post subject. A string or null.
  • text Marked up post text. A string or null.
  • threadNumber The number of the thread this post belongs to.
  • updatedAt Last post update date and time in ISO format. May be null if the post was never updated.
  • user Post author information. An object.
  • hashpass User hashpass (hex representation of a SHA-1 hash). May be null.
  • ip IP-address of the user in normalized IPv6 form.
  • level User access level. "SUPERUSER", "ADMIN", "MODER", "USER", or null.
  • password Hashed (SHA-1) user password. May be null.
  • bannedFor Determines whether the post author was banned for this post. May be true or false.
referencedPosts:<boardName>:<postNumber>

A map of posts referenced by this post for each post (both archived and not archived) on each board.

Type: multiple sets. <boardName> and <threadNumber> are the additional parts of the key.

Key: A combination of the referenced post board name and number separated by a semicolon (<boardName>:<postNumber>).

Value: Stringified JSON. Fields:

  • boardName The post's board name.
  • postNumber The number of the post.
  • threadNumber The number of the thread this post belongs to.
  • createdAt Post creation date and time in ISO format.
referringPosts:<boardName>:<postNumber>

A map of posts referring to this post for each post (both archived and not archived) on each board.

Type: multiple sets. <boardName> and <threadNumber> are the additional parts of the key.

Key: A combination of the referring post board name and number separated by a semicolon (<boardName>:<postNumber>).

Value: Stringified JSON. Fields:

  • boardName The post's board name.
  • postNumber The number of the post.
  • threadNumber The number of the thread this post belongs to.
postFileInfoNames:<boardName>:<postNumber>

A list of files attached to this post each post (both archived and not archived) on each board.

Type: multiple unordered sets. <boardName> and <threadNumber> are the additional parts of the key.

Values: Names of the files.

postExtraData

Extra data for each post (both archived and not archived) on each board.

Type: Hash.

Key: A combination of post board name and number separated by a semicolon (<boardName>:<postNumber>).

Value: Depends on the post board. May be null, string, number, or a stringified object.

fileInfos

Information about each file attached to each post.

Type: Hash.

Key: File name.

Value: Stringified JSON. Fields:

  • boardName The name of the board of the post this file is attached to.
  • dimensions File dimensions information. An object or null.
  • height The height of the file.
  • width The width of the file.
  • extraData Extra data. Depends on the file type. May be an object or null.
  • hash Hexadecimal representation of the file SHA-1 hash.
  • mimeType MIME-type of the file.
  • name THe name of the file.
  • postNumber The number of the post this file is attached to.
  • rating The content rating. May be "SFW", "R-15", "R-18", or "R-18G".
  • size The size of the file (in bytes).
  • thumb File thumbnail information. An object.
  • dimensions File thumb dimensions information. An object.
  • height The height of the file thumb.
  • width The width of the file thumb.
  • name The name of the file thumb.
fileHashes:<hash>

A list of brief file information objects for each files with the same hash on each board.

Type: Unordered set.

Values: Stringified JSON. Fields:

  • name The name of the file.
  • thumb File thumbnail information. An object.
  • name The name of the file thumb.
  • size The size of the file (in bytes).
  • boardName The name of the board of the post this file is attached to.
  • mimeType MIME-type of the file.
  • rating The content rating. May be "SFW", "R-15", "R-18", or "R-18G".
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``
``

Note: See also Redis data types documentation.

Clone this wiki locally