UltrasonicNXT has uploaded a new change for review.

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


Change subject: Add user_points SQL files into SocialProfile
......................................................................

Add user_points SQL files into SocialProfile

(Not sure why they were in RandomFeaturedUser).

Added 3 SQL files, plus the DB schema update hook entries. I've tried to
add PostreSQL files too.

Change-Id: Idacaff9d946bf6590338a4c9c0ed97aae24af32b
---
M SocialProfileHooks.php
A UserStats/user_points_archive.postgres.sql
A UserStats/user_points_archive.sql
A UserStats/user_points_monthly.postgres.sql
A UserStats/user_points_monthly.sql
A UserStats/user_points_weekly.postgres.sql
A UserStats/user_points_weekly.sql
7 files changed, 55 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile 
refs/changes/03/97303/1

diff --git a/SocialProfileHooks.php b/SocialProfileHooks.php
index 512ed0f..178a5a0 100644
--- a/SocialProfileHooks.php
+++ b/SocialProfileHooks.php
@@ -49,6 +49,9 @@
                $updater->addExtensionUpdate( array( 'addTable', 'user_gift', 
"$dir/UserGifts/usergifts$dbExt.sql", true ) );
                $updater->addExtensionUpdate( array( 'addTable', 'gift', 
"$dir/UserGifts/usergifts$dbExt.sql", true ) );
                $updater->addExtensionUpdate( array( 'addTable', 
'user_system_messages', 
"$dir/UserSystemMessages/user_system_messages$dbExt.sql", true ) );
+               $updater->addExtensionUpdate( array( 'addTable', 
'user_points_weekly', "$dir/UserStats/user_points_weekly$dbExt.sql", true ) );
+               $updater->addExtensionUpdate( array( 'addTable', 
'user_points_monthly', "$dir/UserStats/user_points_monthly$dbExt.sql", true ) );
+               $updater->addExtensionUpdate( array( 'addTable', 
'user_points_archive', "$dir/UserStats/user_points_archive$dbExt.sql", true ) );
 
                return true;
        }
diff --git a/UserStats/user_points_archive.postgres.sql 
b/UserStats/user_points_archive.postgres.sql
new file mode 100644
index 0000000..175feec
--- /dev/null
+++ b/UserStats/user_points_archive.postgres.sql
@@ -0,0 +1,10 @@
+CREATE TABLE user_points_archive (
+  up_id            INT(11) NOT NULL auto_increment PRIMARY KEY,
+  up_period        INT(2)  NOT NULL DEFAULT '0',
+  up_date datetime DEFAULT NULL,
+  up_user_id       INT(11) NOT NULL DEFAULT '0',
+  up_user_name     TEXT    NOT NULL,
+  up_points        FLOAT   NOT NULL DEFAULT '0'
+);
+
+CREATE INDEX up_user_id ON user_points_archive (up_user_id);
\ No newline at end of file
diff --git a/UserStats/user_points_archive.sql 
b/UserStats/user_points_archive.sql
new file mode 100644
index 0000000..2495d2f
--- /dev/null
+++ b/UserStats/user_points_archive.sql
@@ -0,0 +1,10 @@
+CREATE TABLE /*_*/user_points_archive (
+  `up_id` int(11) NOT NULL auto_increment PRIMARY KEY,
+  `up_period` int(2) NOT NULL default '0',
+  `up_date` datetime default NULL,
+  `up_user_id` int(11) NOT NULL default '0',
+  `up_user_name` varchar(255) NOT NULL,
+  `up_points` float NOT NULL default '0'
+) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/up_user_id ON /*_*/user_points_archive (up_user_id);
\ No newline at end of file
diff --git a/UserStats/user_points_monthly.postgres.sql 
b/UserStats/user_points_monthly.postgres.sql
new file mode 100644
index 0000000..4fa777e
--- /dev/null
+++ b/UserStats/user_points_monthly.postgres.sql
@@ -0,0 +1,8 @@
+CREATE TABLE /*_*/user_points_monthly (
+  `up_id` int(11) NOT NULL auto_increment PRIMARY KEY,
+  `up_user_id` int(11) NOT NULL default '0',
+  `up_user_name` varchar(255) NOT NULL default '',
+  `up_points` float NOT NULL default '0'
+) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/up_user_id ON /*_*/user_points_monthly (up_user_id);
\ No newline at end of file
diff --git a/UserStats/user_points_monthly.sql 
b/UserStats/user_points_monthly.sql
new file mode 100644
index 0000000..4fa777e
--- /dev/null
+++ b/UserStats/user_points_monthly.sql
@@ -0,0 +1,8 @@
+CREATE TABLE /*_*/user_points_monthly (
+  `up_id` int(11) NOT NULL auto_increment PRIMARY KEY,
+  `up_user_id` int(11) NOT NULL default '0',
+  `up_user_name` varchar(255) NOT NULL default '',
+  `up_points` float NOT NULL default '0'
+) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/up_user_id ON /*_*/user_points_monthly (up_user_id);
\ No newline at end of file
diff --git a/UserStats/user_points_weekly.postgres.sql 
b/UserStats/user_points_weekly.postgres.sql
new file mode 100644
index 0000000..bd95f2c
--- /dev/null
+++ b/UserStats/user_points_weekly.postgres.sql
@@ -0,0 +1,8 @@
+CREATE TABLE user_points_weekly (
+  up_id        INT(11) NOT NULL auto_increment PRIMARY KEY,
+  up_user_id   INT(11) NOT NULL default '0',
+  up_user_name TEXT    NOT NULL default '',
+  up_points    FLOAT   NOT NULL default '0'
+);
+
+CREATE INDEX up_user_id ON user_points_weekly (up_user_id);
\ No newline at end of file
diff --git a/UserStats/user_points_weekly.sql b/UserStats/user_points_weekly.sql
new file mode 100644
index 0000000..bd95f2c
--- /dev/null
+++ b/UserStats/user_points_weekly.sql
@@ -0,0 +1,8 @@
+CREATE TABLE user_points_weekly (
+  up_id        INT(11) NOT NULL auto_increment PRIMARY KEY,
+  up_user_id   INT(11) NOT NULL default '0',
+  up_user_name TEXT    NOT NULL default '',
+  up_points    FLOAT   NOT NULL default '0'
+);
+
+CREATE INDEX up_user_id ON user_points_weekly (up_user_id);
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idacaff9d946bf6590338a4c9c0ed97aae24af32b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SocialProfile
Gerrit-Branch: master
Gerrit-Owner: UltrasonicNXT <[email protected]>

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

Reply via email to