Page MenuHomePhabricator

Convert extensions to using abstract schema
Open, Needs TriagePublic

Description

Seeing as T191231: RFC: Abstract schemas and schema changes has been approved, rather than doing tasks like T244898: Notifications ('Echo') should work with postgres, T244899: CentralAuth should work with postgres and T199544: Make AbuseFilter work on PostgreSQL and SQLite (epic), it seems prudent to convert the current schemas to the abstract syntax and use that to generate the PG schema, rather than building a schema manually ourselves

The TLDR guide for this:

  • Write a tables.json for the schema (see maintenance/tables.json in mw core)
  • Run maintenance/generateSchemaSql.php on the tables.json you created to generate the sql files
  • git add the new files. Wire them in as normal in your LoadExtensionSchemaUpdates subscriber

More information can be seen at https://www.mediawiki.org/wiki/Manual:Schema_changes

Related Objects

StatusSubtypeAssignedTask
ResolvedLadsgroup
OpenNone
OpenNone
ResolvedNone
ResolvedNone
ResolvedJdforrester-WMF
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedDaimona
ResolvedMarostegui
Resolved Bstorm
ResolvedDaimona
ResolvedUrbanecm
ResolvedMarostegui
Resolvedrook
DuplicateNone
ResolvedUmherirrender
InvalidNone
InvalidNone
ResolvedReedy
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
InvalidNone
ResolvedReedy
ResolvedReedy
InvalidNone
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedJdforrester-WMF
ResolvedReedy
ResolvedReedy
ResolvedReedy
InvalidNone
DeclinedNone
ResolvedReedy
InvalidNone
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedPhysikerwelt
InvalidNone
ResolvedUmherirrender
ResolvedReedy
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedReedy
ResolvedUmherirrender
ResolvedUmherirrender
InvalidNone
ResolvedReedy
ResolvedUmherirrender
ResolvedSTran
ResolvedUmherirrender
ResolvedTchanders
ResolvedUmherirrender
InvalidNone
InvalidNone
InvalidNone
Resolvedawight
ResolvedReedy
InvalidNone
ResolvedLadsgroup
InvalidNone
ResolvedUmherirrender
ResolvedUmherirrender
OpenNone
ResolvedNone
OpenNone

Event Timeline

Reedy updated the task description. (Show Details)

An extra step would be to add a test to make sure the .sql files are indeed generated from the abstract schemas (so we don't end up people doing the old way). There is such test in core already, maybe we can sorta hook it up so they define it extension.json? What do you think?

An extra step would be to add a test to make sure the .sql files are indeed generated from the abstract schemas (so we don't end up people doing the old way). There is such test in core already, maybe we can sorta hook it up so they define it extension.json? What do you think?

I think minimal possible "effort" to have this test in an extension would be a win, yeah

Change 621905 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/BetaFeatures@master] Convert BetaFeatures to use abstract schema

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

Change 621909 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/ProofreadPage@master] Convert ProofreadPage to use abstract schema

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

Change 621912 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/Linter@master] Convert Linter to abstract schema

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

Change 621915 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/Babel@master] Convert Babel to use abstract schema

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

Change 621917 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/TimedMediaHandler@master] Convert TimedMediaHandler to abstract schema

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

Change 621919 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/ShortUrl@master] Convert ShortUrl to use abstract schema

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

Change 621922 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/OATHAuth@master] Update OATHAuth to Abstract Schema

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

Change 621924 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/WikiLove@master] Convert WikiLove to use abstract schema

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

Change 621909 merged by jenkins-bot:
[mediawiki/extensions/ProofreadPage@master] Convert ProofreadPage to use abstract schema

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

Change 621905 merged by jenkins-bot:
[mediawiki/extensions/BetaFeatures@master] Convert BetaFeatures to use abstract schema

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

Change 621924 merged by jenkins-bot:
[mediawiki/extensions/WikiLove@master] Convert WikiLove to use abstract schema

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

Change 621917 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] Convert TimedMediaHandler to abstract schema

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

Change 621912 merged by jenkins-bot:
[mediawiki/extensions/Linter@master] Convert Linter to abstract schema

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

Change 621919 merged by jenkins-bot:
[mediawiki/extensions/ShortUrl@master] Convert ShortUrl to use abstract schema

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

Change 621915 merged by jenkins-bot:
[mediawiki/extensions/Babel@master] Convert Babel to use abstract schema

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

Change 633472 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/UrlShortener@master] Update UrlShortener to use Abstract schema

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

Change 633472 merged by jenkins-bot:
[mediawiki/extensions/UrlShortener@master] Update UrlShortener to use Abstract schema

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

The initiative is over and these are improvements that are welcome but not really any blocker to call the project done specially given the fact that all wmf-deployed extensions have been migrated.