Page MenuHomePhabricator

New database tables for focus areas
Closed, ResolvedPublic3 Estimated Story Points

Description

What + Why

Focus area data data needs to be stored in database tables.

Details

This ticket is to update and create the DB tables themselves

  • community_requests_focus_areas:
    • crfa_page (int) FK to page.page_id for the base untranslated page
    • crfa_status (int) ID of a status as stored in the code (i.e. not a FK)
    • crfa_vote_count (int)
  • community_requests_focus_area_translations:
    • crfat_id (int) PK
    • crfat_fa_id (int) FK to community_requests_focus_areas.crfa_id
    • crfat_lang (text) The lang code of the text in this row
    • crfat_is_base_lang (bool) Whether this lang is the original untranslated one
    • crfat_title (text)
    • crfat_description (text) This corresponds to the short_description of the Community_Wishlist/Focus_area template.

See T387957 for the equivalent task for the wishes' DB structure.

  1. Tipps for QA:

Event Timeline

Looks good! Minor corrections:

  • communityrequests_focus_areas should be community_requests_focus_areas (assuming we don't care to rename existing tables)
  • communityrequests_focus_area_texts could instead be community_requests_focus_area_translations for parity with T387957 (or the inverse)

I think *_translations is clearest, although slightly longer.

Removed the PK from community_requests_focus_areas based on the reasoning in https://phabricator.wikimedia.org/T387957#10659061 (i.e. we don't really need a separate auto-incrementing PK as there will always be a corresponding page)

Cparle renamed this task from New database tables for focus areas, plus php interface for them to New database tables for focus areas.Apr 29 2025, 4:30 PM
Cparle updated the task description. (Show Details)

Change #1139951 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CommunityRequests@master] sql: update schema for focus areas to include translations

https://gerrit.wikimedia.org/r/1139951

Change #1139950 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CommunityRequests@master] sql: update schema to include translations, remove votes table

https://gerrit.wikimedia.org/r/1139950

Change #1139951 abandoned by MusikAnimal:

[mediawiki/extensions/CommunityRequests@master] sql: update schema for focus areas to include translations

Reason:

merged into Ic8f0442f8a2d59760d2ea2bb9cba64fb20f80fed

https://gerrit.wikimedia.org/r/1139951

@MusikAnimal I added a section for "QA Tipps" as this is something we generally neglect, see QA concerns during Retro.
As this is a database change and won't be surfaced to the UI, how will QA be able to verify this?

@MusikAnimal I added a section for "QA Tipps" as this is something we generally neglect, see QA concerns during Retro.
As this is a database change and won't be surfaced to the UI, how will QA be able to verify this?

They won't! Tim is essentially the QA for the database schema :)

I think it may be a bit before we need QA. https://wishlist-test.toolforge.org/wiki/Community_Wishlist will eventually be where testing is done, but right now what you see isn't data coming from the extension. I'll work with George to come up with a test plan when the time comes.

Change #1139950 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] sql: redesign schema, starting with a clean slate

https://gerrit.wikimedia.org/r/1139950