Jack Phoenix has submitted this change and it was merged.
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.
Bug: 44607
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, 64 insertions(+), 0 deletions(-)
Approvals:
Jack Phoenix: Verified; Looks good to me, approved
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..3097980
--- /dev/null
+++ b/UserStats/user_points_archive.postgres.sql
@@ -0,0 +1,13 @@
+DROP SEQUENCE IF EXISTS user_points_archive_up_id_seq CASCADE;
+CREATE SEQUENCE user_points_archive_up_id_seq MINVALUE 0 START WITH 0;
+
+CREATE TABLE user_points_archive (
+ up_id INT(11) NOT NULL DEFAULT
nextval('user_points_archive_up_id_seq') 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..7886d82
--- /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..dcda675
--- /dev/null
+++ b/UserStats/user_points_monthly.postgres.sql
@@ -0,0 +1,11 @@
+DROP SEQUENCE IF EXISTS user_points_monthly_up_id_seq CASCADE;
+CREATE SEQUENCE user_points_monthly_up_id_seq MINVALUE 0 START WITH 0;
+
+CREATE TABLE user_points_monthly (
+ up_id INT(11) NOT NULL default
nextval('user_points_monthly_up_id_seq') 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_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..80b24bb
--- /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..5fc53bb
--- /dev/null
+++ b/UserStats/user_points_weekly.postgres.sql
@@ -0,0 +1,11 @@
+DROP SEQUENCE IF EXISTS user_points_weekly_up_id_seq CASCADE;
+CREATE SEQUENCE user_points_weekly_up_id_seq MINVALUE 0 START WITH 0;
+
+CREATE TABLE user_points_weekly (
+ up_id INT(11) NOT NULL default
nextval('user_points_weekly_up_id_seq') 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..f9f8702
--- /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 varchar(255) NOT NULL default '',
+ up_points float NOT NULL default 0
+) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/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: merged
Gerrit-Change-Id: Idacaff9d946bf6590338a4c9c0ed97aae24af32b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SocialProfile
Gerrit-Branch: master
Gerrit-Owner: UltrasonicNXT <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits