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 May 21, 2016 · 26 revisions

Contents

Note: See also Redis data types documentation.

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 hashes. <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 hashes. <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: Multiple unordered sets. <hash> is the additional part of the key.

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".
voteUsers:<postNumber>

A list of IP addresses of the users who voted in the voting attached to the post on the /rpg/ board.

Type: multiple unordered sets. <postNumber> is the additional part of the key.

Values: IP addresses in the normalized IPv6 form.

voteVariantUsers:<postNumber>:<ID>

A list of IP addresses of the users who voted for the specific variant in the voting attached to the post on the /rpg/ board.

Type: multiple unordered sets. <postNumber> and <ID> are the additional parts of the key.

Values: IP addresses in the normalized IPv6 form.

postsPlannedForDeletion

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

Type: Unordered set.

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

captchaQuotas

Captcha quota for each user on each board.

Type: Hash.

Key: A combination of board name and user IP address in IPv6 form separated by a semicolon (<boardName>:<IP>).

Value: The quota (an integer number greater or equal to zero).

registeredUserLevels:<hash>

Registered user levels for each user on each board.

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

Key: Board name.

Value: User access level. Either "ADMIN", "MODER", or "USER".

registeredUserHashes

Registered user hashes for each user IP address.

Type: Hash.

Key: User IP address in IPv6 normalized form.

Value: User hashpass (a hexadecimal representation of a SHA-1 hash).

registeredUserIps:<hash>

A list of registered user IP addresses for each registered user.

Type: multiple unorderes sets. <hash> is the additional part of the key.

Values: User IP addresses in IPv6 normalized form.

superuserHashes

Superuser hashes.

Type: Unordered set.

Values: User hashpasses (hexadecimal representations of SHA-1 hashes).

userPostNumbers:<IP>:<boardName>

A list of post numbers for each user IP address on each board.

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

Key: Post numbers.

bannedUserIps

A list of IP addresses of the banned users.

Type: Unordered set.

Values: Banned user IP addresses in IPv6 normalized form.

userBans:<IP>:<boardName>

Ban level information for each banned user on each board.

Type: A single value. <IP> and <boardName> are the additional parts of the key.

Value: Stringified JSON. Fields:

  • boardName The name of the board of the post for which the ban was assigned. May be null.
  • expiresAt The date and time when the ban expires in ISO format, or null (if the ban never expires).
  • level The ban level. Either "READ_ONLY", or "NO_ACCESS".
  • reason The reason for which the ban was assigned.
  • postNumber The number of the post for which the ban was assigned. Either an integer number greater than zeor, or null.
  • createdAt Ban creation date and time in ISO format.
userBanPostNumbers

Banned user post number related to each ban.

Type: Hash.

Key: a key used for [userBans:IP:boardName](IV. Database schema#userbansipboardname).

Value: Post number (a Number).

chats:<hash>

A list of chats for each user.

Type: multiple unordered sets. <hash> is the additional part of the key.

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

chat:<boardName>:<postNumber>

A list of messages in each chat.

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

Values: Stringified JSONs. Fields:

  • text The text of the message.
  • date The date and time the message was sent in ISO format.
  • senderHash Hash of the sender (either hashpass, or a SHA-1 hash of the IP address).
  • receiverHash Hash of the receiver (either hashpass, or a SHA-1 hash of the IP address).
chatMembers:<boardName>:<postNumber>

A list of members of each chat.

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

Values: Stringified JSONs. Fields:

  • ip IP address of the member.
  • hashpass Hashpass of the member.
  • hash Hash of the member (either hashpass, or a SHA-1 hash of the IP address).
synchronizationData:<key>

A list of synchronization data.

Type: multiple unordered sets. <key> is the additional part of the key.

Values: Stringified JSONs (user local settings synchronization data).

deletedThreads

A list of all threads deleted while the application was running. Cleared on every application launch.

Type: Unordered set.

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

Clone this wiki locally