Physikerwelt has uploaded a new change for review.

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

Change subject: Use update to add fk for mathindex
......................................................................

Use update to add fk for mathindex

Change-Id: I5812d172f1bb8083881741d796876b450eb24000
---
M MathSearch.hooks.php
M db/mathindex.sql
A db/patches/mathindexHashConstraint.sql
3 files changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/07/250907/1

diff --git a/MathSearch.hooks.php b/MathSearch.hooks.php
index 8763749..d7de7f0 100644
--- a/MathSearch.hooks.php
+++ b/MathSearch.hooks.php
@@ -57,6 +57,8 @@
                                $updater->addExtensionTable( 
'math_wmc_assessed_revision',
                                        $wmcDir . 
"math_wmc_assessed_revision.sql" );
                        }
+                       $updater->addExtensionIndex('mathindex', 
'fk_mathindex_hash',
+                               "$dir/patches/mathindexHashConstraint.sql" );
                } else {
                        throw new Exception( "Math extension does not currently 
support $type database." );
                }
diff --git a/db/mathindex.sql b/db/mathindex.sql
index 3859367..4a7e5d3 100644
--- a/db/mathindex.sql
+++ b/db/mathindex.sql
@@ -20,7 +20,6 @@
   mathindex_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP,
 
   PRIMARY KEY (mathindex_revision_id,mathindex_anchor),
-  FOREIGN KEY ( /*i*/mathindex_inputhash ) REFERENCES mathlatexml( 
math_inputhash ),
   FOREIGN KEY ( /*i*/mathindex_revision_id ) REFERENCES revision( rev_id ) ON 
DELETE CASCADE
 
 ) /*$wgDBTableOptions*/;
\ No newline at end of file
diff --git a/db/patches/mathindexHashConstraint.sql 
b/db/patches/mathindexHashConstraint.sql
new file mode 100644
index 0000000..a372941
--- /dev/null
+++ b/db/patches/mathindexHashConstraint.sql
@@ -0,0 +1,4 @@
+ALTER TABLE /*_*/mathindex
+  ADD CONSTRAINT fk_mathindex_hash
+  FOREIGN KEY ( /*i*/mathindex_inputhash )
+  REFERENCES mathlatexml( math_inputhash );
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/250907
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5812d172f1bb8083881741d796876b450eb24000
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to