Adamw has submitted this change and it was merged.

Change subject: Update Campaigns database schema
......................................................................


Update Campaigns database schema

Modifies the tables added in cdcf0bd2ae7e9ad7580b93bd979d0ed3a5c56d69.
Since that schema change hasn't been applied anywhere yet, only one
change (this one) should to be applied.

Change-Id: I422e9eb578d1d701a5422f270b3e87686e0a4df3
---
M sql/CampaignsCampaignTable.sql
M sql/CampaignsParticipationTable.sql
2 files changed, 14 insertions(+), 18 deletions(-)

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



diff --git a/sql/CampaignsCampaignTable.sql b/sql/CampaignsCampaignTable.sql
index f8be31c..501d7b0 100644
--- a/sql/CampaignsCampaignTable.sql
+++ b/sql/CampaignsCampaignTable.sql
@@ -7,20 +7,17 @@
        -- Time the campaign was created
        campaign_time_created varbinary(14) NOT NULL,
 
+       -- Time the campaign ended
+       campaign_time_ended varbinary(14),
+
        -- A string to identify the campaign in URLs
-       campaign_url_id varchar(255) NOT NULL UNIQUE,
+       campaign_url_key varchar(255) NOT NULL UNIQUE,
 
        -- Name of the campaign
        campaign_name varchar(255) NOT NULL UNIQUE,
 
-       -- ID of a page about the campaign, foreign key on page.page_id
-       campaign_wikipage_id int unsigned,
-
-       -- Flag to use only event logging to record participations in this 
campaign
-       -- (i.e., just log via server-side when an account is created with the
-       -- campaign's URL ID in the URL)
-       -- Note that MySQL has no native boolean type, it's just a synonym for 
this
-       campaign_only_event_logging tinyint(1) NOT NULL default false
+       -- String title of the campaign's home page on this wiki
+       campaign_home_page_title_text varchar(255)
 
 ) /*$wgDBTableOptions*/;
 
@@ -29,7 +26,7 @@
        /*_*/campaigns_campaign (campaign_id);
 
 CREATE UNIQUE INDEX /*i*/campaigns_campaign_url_id ON
-       /*_*/campaigns_campaign (campaign_url_id);
+       /*_*/campaigns_campaign (campaign_url_key);
 
 CREATE UNIQUE INDEX /*i*/campaigns_campaign_name ON
        /*_*/campaigns_campaign (campaign_name);
diff --git a/sql/CampaignsParticipationTable.sql 
b/sql/CampaignsParticipationTable.sql
index 271c52a..06313b4 100644
--- a/sql/CampaignsParticipationTable.sql
+++ b/sql/CampaignsParticipationTable.sql
@@ -13,11 +13,8 @@
        -- Time the user joined the campaign
        participation_time_joined varbinary(14) NOT NULL,
 
-       -- Time the user left the campaign
-       participation_time_left varbinary(14),
-
        -- Flag for campaign organizers
-       participation_organizer boolean NOT NULL default false
+       participation_organizer boolean NOT NULL
 
 ) /*$wgDBTableOptions*/;
 
@@ -31,8 +28,10 @@
 CREATE INDEX /*i*/campaigns_participation_camp_id ON
        /*_*/campaigns_participation (participation_campaign_id);
 
-CREATE INDEX /*i*/campaigns_participation_time_left ON
-       /*_*/campaigns_participation (participation_time_left);
-
 CREATE INDEX /*i*/campaigns_participation_organizer ON
-       /*_*/campaigns_participation (participation_organizer);
\ No newline at end of file
+       /*_*/campaigns_participation (participation_organizer);
+
+-- This index helps us avoid locking reads when setting a participation
+CREATE UNIQUE INDEX /*i*/campaigns_participation_user_campaign ON
+       /*_*/campaigns_participation (participation_user_id,
+       participation_campaign_id);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I422e9eb578d1d701a5422f270b3e87686e0a4df3
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Campaigns
Gerrit-Branch: wip/editorcampaigns
Gerrit-Owner: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Adamw <awi...@wikimedia.org>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Ragesoss <rages...@gmail.com>
Gerrit-Reviewer: Swalling <swall...@wikimedia.org>
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