Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create/update schema with update.php script
Add handler for 'LoadExtensionSchemaUpdates' hook and create/update database schema when maintenance script update.php from core is run. Without this, extension users needed to manually run the SQL scripts from sql/ folder in order for the extension to be functional after downloading and registering in LocalSettings.php Documentation page on mediawiki.org does not list these as necessary steps towards installing the extension and only mentiones sql/contenttranslation.sql file. Also, split SQL files per table definition and remove unnecessary (and potentially dangerous) DROP TABLE statements at the beginning of files. Change-Id: I449817e3038bfc4c7a139acc73905ca19c19f72c
- Loading branch information
petarpetkovic
committed
Apr 23, 2019
1 parent
caae07b
commit bbd5328
Showing
7 changed files
with
67 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CREATE TABLE /*_*/cx_suggestions ( | ||
-- Foreign key to cxl_id | ||
cxs_list_id int NOT NULL, | ||
-- Source language code | ||
cxs_source_language varbinary(36) NOT NULL, | ||
-- Target language code | ||
cxs_target_language varbinary(36), | ||
-- Title of the suggestion | ||
cxs_title varbinary(512) NOT NULL | ||
) /*$wgDBTableOptions*/; | ||
|
||
CREATE INDEX /*i*/cx_suggestions_by_lang ON /*_*/cx_suggestions ( | ||
cxs_list_id, | ||
cxs_source_language, | ||
cxs_target_language | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CREATE TABLE /*_*/cx_translators ( | ||
-- Translators id - global user id | ||
translator_user_id int not null, | ||
-- Translation id - foreign key to translations.translation_id | ||
translator_translation_id int not null | ||
) /*$wgDBTableOptions*/; | ||
|
||
CREATE UNIQUE INDEX /*i*/cx_translation_translators ON /*_*/cx_translators ( | ||
translator_user_id, | ||
translator_translation_id | ||
); |