jenkins-bot has submitted this change and it was merged.

Change subject: Drop unique part from oresm_model index
......................................................................


Drop unique part from oresm_model index

It will cause issues when we have two models with oresm_is_current = 0

Bug: T144432
Change-Id: I1ab131875287d981c8458b798c5afcd027de6584
---
M includes/Hooks.php
M sql/ores_model.sql
A sql/patch-ores-model-indexes.sql
3 files changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Hooks.php b/includes/Hooks.php
index d7faa53..531e9d8 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -33,7 +33,8 @@
                        __DIR__ . 
'/../sql/patch-ores-classification-indexes.sql' );
                $updater->addExtensionIndex( 'ores_classification', 
'oresc_rev_model_class',
                        __DIR__ . 
'/../sql/patch-ores-classification-unique-indexes.sql' );
-
+               $updater->addExtensionIndex( 'ores_model', 'oresm_model_status',
+                       __DIR__ . '/../sql/patch-ores-model-indexes.sql' );
                return true;
        }
 
diff --git a/sql/ores_model.sql b/sql/ores_model.sql
index cc397a1..a269968 100644
--- a/sql/ores_model.sql
+++ b/sql/ores_model.sql
@@ -11,5 +11,5 @@
 
 ) /*$wgDBTableOptions*/;
 
-CREATE UNIQUE INDEX /*i*/oresm_model ON /*_*/ores_model (oresm_name, 
oresm_is_current);
+CREATE INDEX /*i*/oresm_model_status ON /*_*/ores_model (oresm_name, 
oresm_is_current);
 CREATE UNIQUE INDEX /*i*/oresm_version ON /*_*/ores_model (oresm_name, 
oresm_version);
diff --git a/sql/patch-ores-model-indexes.sql b/sql/patch-ores-model-indexes.sql
new file mode 100644
index 0000000..143c52b
--- /dev/null
+++ b/sql/patch-ores-model-indexes.sql
@@ -0,0 +1,7 @@
+--
+-- patch-ores-model-indexes.sql
+--
+-- Remove unique contraint from index oresm_model
+
+DROP INDEX /*i*/oresm_model ON /*_*/ores_model;
+CREATE INDEX /*i*/oresm_model_status ON /*_*/ores_model (oresm_name, 
oresm_is_current);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ab131875287d981c8458b798c5afcd027de6584
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Springle <sprin...@wikimedia.org>
Gerrit-Reviewer: Thiemo M├Ąttig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to