Page MenuHomePhabricator

Remove database column page.page_restrictions from MediaWiki core
Closed, ResolvedPublic

Description

The field of page_restrictions of page table is superseded by the page_restriction table. Please remove that field to keep the database schema clean. Thanks.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:06 AM
bzimport set Reference to bz33334.

Yah, the table is called "page_restrictions", the same as the field in page table.

I think it should be fairly easy to remove page.page_restrictions. It just requires a few schema patches, as I recall.

I prepared the schema patches but I'm confused as to what is to be done with Title::loadRestrictionsFromRows which compiles page restrictions from both page table and page_restrictions table. There are many occurences of page_restrictions in WikiPage.php. Should all that be removed?

Change 108219 had a related patch set uploaded by Tinaj1234:
Removing page_restrictions from page table

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

Existing entries in page_restriction field should be migrated to the page_restriction table.

Tinaj1234 set Security to None.

Existing entries in page_restriction field should be migrated to the page_restriction table.

There is a script for this, updateRestrictions.php, which is run by update.php.

It looks like the part not done already is removing the column, both as a patch and from tables.sql.

Krinkle changed the task status from Open to Stalled.Jul 18 2019, 9:40 PM
Krinkle subscribed.

Read queries should be removed before the schema patch, preferably in a separate patch.

Ladsgroup changed the task status from Stalled to Open.May 24 2022, 8:40 AM
Ladsgroup claimed this task.
Ladsgroup edited projects, added DBA; removed Patch-For-Review.
Ladsgroup subscribed.

Doing it.

Change 798445 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] schema: Drop legacy page_restrictions in page table

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

Change 798445 merged by jenkins-bot:

[mediawiki/core@master] schema: Drop legacy page_restrictions in page table

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

Ladsgroup moved this task from In progress to Done on the DBA board.

LiquidThread still selects that column, now causing fatals: T309460.

Sorry about that. Will fix it. I'm sure we didn't have any data loss, it's just fatals.