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
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenNone
InvalidNone
InvalidNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedReedy
InvalidNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
InvalidNone
OpenNone
OpenNone
InvalidNone
OpenNone
OpenNone
OpenNone
InvalidNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
InvalidNone
OpenNone
OpenNone
OpenNone
InvalidNone
InvalidNone
InvalidNone
OpenNone
OpenNone
InvalidNone
OpenNone
InvalidNone
OpenNone

Event Timeline

Reedy created this task.Jul 31 2020, 5:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 31 2020, 5:11 PM
Reedy updated the task description. (Show Details)Jul 31 2020, 5:25 PM
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?

Reedy added a comment.Aug 22 2020, 8:19 PM

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

Tgr added a subscriber: Tgr.Oct 18 2020, 6:36 PM