Page MenuHomePhabricator

Setup Database schema for Reading Lists
Closed, ResolvedPublic


These tables should reside in a database that will be convenient for accessing the central auth account of a user.

Create 3 tables:

reading_list table:

  • rl_id
  • rl_user_id: central ID of the user
  • rl_is_default: flag to tell apart the initial list from the rest, for UX purposes and to forbid deleting it
  • rl_name: human-readable name, non-unique
  • rl_description
  • various other metadata: color, image, icon (TBD: should these be in a separate key-value table to make adding/removing metadata types easier?)
  • rl_date_created
  • rl_date_updated
  • rl_deleted (we need soft-delete for sync)
  • indexes: (rl_user_id, rl_date_updated) for the /since/ route, (rl_user_id, rl_deleted) for getting all

reading_list_entry table:

  • rle_id
  • rle_list_id
  • rl_user_id: central ID of the user (denormalized for the benefit of the /pages/ route)
  • rle_project: wiki project domain (TBD: use a lookup table / some other way of compression?)
  • rle_title: page title (can't easily use page ids due to the cross-wiki nature of the project. Also, page ids don't age well when content is deleted/moved.)
  • rle_date_created
  • rle_date_updated
  • rle_deleted
  • indexes: (rle_list_id, rle_date_updated) for the /since/ route and all entries in a list, (rle_user_id, rle_project, rle_title) for the /pages/ route

reading_list_sort_index table:

  • rlsi_rl_id
  • rlsi_index
  • indexes: (rlsi_index)


Event Timeline

Change 365987 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/ReadingLists@master] [WIP] DB layer

Change 365987 merged by jenkins-bot:
[mediawiki/extensions/ReadingLists@master] Database schema and DB handling code