From b59463552644ca4afd9e8ca7edd761ae382fc8ed Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 8 Sep 2012 13:09:34 -0500 Subject: [ticket/11103] Add tables to the database updater and installer PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 6eb4a80199..88aa9b70dd 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1295,6 +1295,28 @@ function get_schema_struct() ), ); + $schema_data['phpbb_notifications'] = array( + 'COLUMNS' => array( + 'item_type' => array('UINT', 0), + 'item_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'unread' => array('BOOL', 1), + 'time' => array('TIMESTAMP', 1), + 'data' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => array( + 'item_type', + 'item_id', + 'user_id', + ), + 'KEYS' => array( + 'item_type' => array('INDEX', 'item_type'), + 'item_id' => array('INDEX', 'item_id'), + 'user_id' => array('INDEX', 'user_id'), + 'time' => array('INDEX', 'time'), + ), + ); + $schema_data['phpbb_poll_options'] = array( 'COLUMNS' => array( 'poll_option_id' => array('TINT:4', 0), @@ -1751,6 +1773,25 @@ function get_schema_struct() ), ); + $schema_data['phpbb_user_notifications'] = array( + 'COLUMNS' => array( + 'item_type' => array('UINT', 0), + 'item_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'method' => array('VCHAR:25', ''), + ), + 'PRIMARY_KEY' => array( + 'item_type', + 'item_id', + 'user_id', + 'method', + ), + 'KEYS' => array( + 'it' => array('INDEX', 'item_type'), + 'uid' => array('INDEX', 'user_id'), + ), + ); + $schema_data['phpbb_user_group'] = array( 'COLUMNS' => array( 'group_id' => array('UINT', 0), -- cgit v1.2.1 From 1e53f7df9d430422e7bb827f3449ef744fc1ed6f Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 8 Sep 2012 16:02:32 -0500 Subject: [ticket/11103] Fixing some db columns that were of the incorrect type PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 88aa9b70dd..a2f7463dd4 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1297,7 +1297,7 @@ function get_schema_struct() $schema_data['phpbb_notifications'] = array( 'COLUMNS' => array( - 'item_type' => array('UINT', 0), + 'item_type' => array('VCHAR:25', ''), 'item_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'unread' => array('BOOL', 1), @@ -1775,7 +1775,7 @@ function get_schema_struct() $schema_data['phpbb_user_notifications'] = array( 'COLUMNS' => array( - 'item_type' => array('UINT', 0), + 'item_type' => array('VCHAR:25', ''), 'item_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'method' => array('VCHAR:25', ''), -- cgit v1.2.1 From fb0ed78c8fffe95d40e47c8dd27d44973eba88ae Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 14 Sep 2012 15:59:13 -0500 Subject: [ticket/11103] Store the item's parent id for marking things read Mark topics/posts read from the markread() function. Identify unread items by a grey background in the header (for now) PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index a2f7463dd4..0483ae009d 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1299,6 +1299,7 @@ function get_schema_struct() 'COLUMNS' => array( 'item_type' => array('VCHAR:25', ''), 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'unread' => array('BOOL', 1), 'time' => array('TIMESTAMP', 1), @@ -1312,8 +1313,10 @@ function get_schema_struct() 'KEYS' => array( 'item_type' => array('INDEX', 'item_type'), 'item_id' => array('INDEX', 'item_id'), + 'item_pid' => array('INDEX', 'item_parent_id'), 'user_id' => array('INDEX', 'user_id'), 'time' => array('INDEX', 'time'), + 'unread' => array('INDEX', 'unread'), ), ); -- cgit v1.2.1 From 7589a3093d95048f5a8cfdc6259501f43fd3fe10 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 14 Sep 2012 18:30:12 -0500 Subject: [ticket/11103] Display all unread notifications by default Add unread count to the page title PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 0483ae009d..a1bef4a85a 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1297,6 +1297,7 @@ function get_schema_struct() $schema_data['phpbb_notifications'] = array( 'COLUMNS' => array( + 'notification_id' => array('UINT', NULL, 'auto_increment'), 'item_type' => array('VCHAR:25', ''), 'item_id' => array('UINT', 0), 'item_parent_id' => array('UINT', 0), @@ -1305,11 +1306,7 @@ function get_schema_struct() 'time' => array('TIMESTAMP', 1), 'data' => array('TEXT_UNI', ''), ), - 'PRIMARY_KEY' => array( - 'item_type', - 'item_id', - 'user_id', - ), + 'PRIMARY_KEY' => 'notification_id', 'KEYS' => array( 'item_type' => array('INDEX', 'item_type'), 'item_id' => array('INDEX', 'item_id'), -- cgit v1.2.1 From 94ffbb4050b2985ee62be0ecc0c6a244532e43ca Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 13 Oct 2012 23:24:30 -0500 Subject: [ticket/11103] Add is_disabled column to notifications table EXTENSION AUTHORS TAKE NOTE! This is to prevent errors with notifications from extensions! Set is_disabled to 1 for all your notifications when your extension is disabled so they are ignored and do not cause errors. When your extension is enabled again, set is_disabled to 0 and your notifications will be working again. PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index a1bef4a85a..69aca10e6c 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1303,6 +1303,7 @@ function get_schema_struct() 'item_parent_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'unread' => array('BOOL', 1), + 'is_disabled' => array('BOOL', 0), 'time' => array('TIMESTAMP', 1), 'data' => array('TEXT_UNI', ''), ), @@ -1314,6 +1315,7 @@ function get_schema_struct() 'user_id' => array('INDEX', 'user_id'), 'time' => array('INDEX', 'time'), 'unread' => array('INDEX', 'unread'), + 'is_disabled' => array('INDEX', 'is_disabled'), ), ); -- cgit v1.2.1 From 471ca5e7dc8276e80e790e05a2ae36dfe35cfe10 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 19 Oct 2012 15:49:49 -0500 Subject: [ticket/11103] Change is_disabled to is_enabled If you're following along and would like to update your DB, you can run the following queries to do so: ALTER TABLE phpbb_notifications CHANGE `is_disabled` `is_enabled` TINYINT( 1 ) NOT NULL DEFAULT '1'; UPDATE `phpbb_notifications` SET is_enabled = 1; PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 69aca10e6c..aa0f13ccb3 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1303,7 +1303,7 @@ function get_schema_struct() 'item_parent_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'unread' => array('BOOL', 1), - 'is_disabled' => array('BOOL', 0), + 'is_enabled' => array('BOOL', 0), 'time' => array('TIMESTAMP', 1), 'data' => array('TEXT_UNI', ''), ), @@ -1315,7 +1315,7 @@ function get_schema_struct() 'user_id' => array('INDEX', 'user_id'), 'time' => array('INDEX', 'time'), 'unread' => array('INDEX', 'unread'), - 'is_disabled' => array('INDEX', 'is_disabled'), + 'is_enabled' => array('INDEX', 'is_enabled'), ), ); -- cgit v1.2.1 From 94d682f77431add84867bb0b196ad0719b293606 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 20 Oct 2012 20:54:18 -0500 Subject: [ticket/11103] Use the full class name as the item_type/method This is going to require you recreate the db tables. PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index aa0f13ccb3..b0cffd167f 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1298,12 +1298,12 @@ function get_schema_struct() $schema_data['phpbb_notifications'] = array( 'COLUMNS' => array( 'notification_id' => array('UINT', NULL, 'auto_increment'), - 'item_type' => array('VCHAR:25', ''), + 'item_type' => array('VCHAR:255', ''), 'item_id' => array('UINT', 0), 'item_parent_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'unread' => array('BOOL', 1), - 'is_enabled' => array('BOOL', 0), + 'is_enabled' => array('BOOL', 1), 'time' => array('TIMESTAMP', 1), 'data' => array('TEXT_UNI', ''), ), @@ -1777,10 +1777,10 @@ function get_schema_struct() $schema_data['phpbb_user_notifications'] = array( 'COLUMNS' => array( - 'item_type' => array('VCHAR:25', ''), + 'item_type' => array('VCHAR:255', ''), 'item_id' => array('UINT', 0), 'user_id' => array('UINT', 0), - 'method' => array('VCHAR:25', ''), + 'method' => array('VCHAR:255', ''), ), 'PRIMARY_KEY' => array( 'item_type', -- cgit v1.2.1 From e549b7663da47d7518b93074e513c7e1d034bf52 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 29 Oct 2012 18:09:20 -0500 Subject: [ticket/11103] Set basic notifications to be enabled by default Now, if there is no row for the user in the user_notifications table, the user will receive basic notifications. If the user wishes to not receive notifications, a row must be added with notify = 0. For other methods besides the basic (e.g. email, jabber) a row must still be added with notify = 1 for them to receive notifications PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index b0cffd167f..9b0afc241d 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1781,6 +1781,7 @@ function get_schema_struct() 'item_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'method' => array('VCHAR:255', ''), + 'notify' => array('BOOL', 1), ), 'PRIMARY_KEY' => array( 'item_type', @@ -1791,6 +1792,7 @@ function get_schema_struct() 'KEYS' => array( 'it' => array('INDEX', 'item_type'), 'uid' => array('INDEX', 'user_id'), + 'no' => array('INDEX', 'notify'), ), ); -- cgit v1.2.1 From 0d6c8f46ffa1206e9d8d71fd30ef04e52f7cb2a8 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 8 Dec 2012 14:12:25 -0600 Subject: [ticket/11103] Update indexes on notifications/user notifications tables PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 3548bc5f05..87204f9e26 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1309,13 +1309,8 @@ function get_schema_struct() ), 'PRIMARY_KEY' => 'notification_id', 'KEYS' => array( - 'item_type' => array('INDEX', 'item_type'), - 'item_id' => array('INDEX', 'item_id'), - 'item_pid' => array('INDEX', 'item_parent_id'), - 'user_id' => array('INDEX', 'user_id'), - 'time' => array('INDEX', 'time'), - 'unread' => array('INDEX', 'unread'), - 'is_enabled' => array('INDEX', 'is_enabled'), + 'item_ident' => array('INDEX', array('item_type', 'item_id')), + 'user' => array('INDEX', array('user_id', 'unread')), ), ); @@ -1791,11 +1786,6 @@ function get_schema_struct() 'user_id', 'method', ), - 'KEYS' => array( - 'it' => array('INDEX', 'item_type'), - 'uid' => array('INDEX', 'user_id'), - 'no' => array('INDEX', 'notify'), - ), ); $schema_data['phpbb_user_group'] = array( -- cgit v1.2.1 From f47e51d6dea9d59a36a6babf1f4033104c93a53d Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 15 Dec 2012 19:18:26 -0600 Subject: [ticket/11103] Move is_enabled to a separate table for better performance PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 87204f9e26..10306c9124 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1295,6 +1295,14 @@ function get_schema_struct() ), ); + $schema_data['phpbb_notification_types'] = array( + 'COLUMNS' => array( + 'notification_type' => array('VCHAR:255', ''), + 'notification_type_enabled' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), + ); + $schema_data['phpbb_notifications'] = array( 'COLUMNS' => array( 'notification_id' => array('UINT', NULL, 'auto_increment'), @@ -1303,7 +1311,6 @@ function get_schema_struct() 'item_parent_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'unread' => array('BOOL', 1), - 'is_enabled' => array('BOOL', 1), 'time' => array('TIMESTAMP', 1), 'data' => array('TEXT_UNI', ''), ), -- cgit v1.2.1 From 47bed3321634d888a51a611e6586c012a27eb1eb Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 15 Dec 2012 21:02:28 -0600 Subject: [ticket/11103] time -> notification_time PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 10306c9124..999ace57d7 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1305,14 +1305,14 @@ function get_schema_struct() $schema_data['phpbb_notifications'] = array( 'COLUMNS' => array( - 'notification_id' => array('UINT', NULL, 'auto_increment'), - 'item_type' => array('VCHAR:255', ''), - 'item_id' => array('UINT', 0), - 'item_parent_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'unread' => array('BOOL', 1), - 'time' => array('TIMESTAMP', 1), - 'data' => array('TEXT_UNI', ''), + 'notification_id' => array('UINT', NULL, 'auto_increment'), + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'unread' => array('BOOL', 1), + 'notification_time' => array('TIMESTAMP', 1), + 'data' => array('TEXT_UNI', ''), ), 'PRIMARY_KEY' => 'notification_id', 'KEYS' => array( -- cgit v1.2.1 From fad6bc5a7e58ddd370b88f73712de350b61bca29 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 15 Dec 2012 21:08:26 -0600 Subject: [ticket/11103] unread -> notification_read PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 999ace57d7..b3c10b1cfa 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1310,14 +1310,14 @@ function get_schema_struct() 'item_id' => array('UINT', 0), 'item_parent_id' => array('UINT', 0), 'user_id' => array('UINT', 0), - 'unread' => array('BOOL', 1), + 'notification_read' => array('BOOL', 0), 'notification_time' => array('TIMESTAMP', 1), 'data' => array('TEXT_UNI', ''), ), 'PRIMARY_KEY' => 'notification_id', 'KEYS' => array( 'item_ident' => array('INDEX', array('item_type', 'item_id')), - 'user' => array('INDEX', array('user_id', 'unread')), + 'user' => array('INDEX', array('user_id', 'notification_read')), ), ); -- cgit v1.2.1 From eeb40181956b578ca98ed0106f3019d8c8299ed3 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 15 Dec 2012 21:17:05 -0600 Subject: [ticket/11103] data -> notification_data PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index b3c10b1cfa..9ffd989597 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1312,7 +1312,7 @@ function get_schema_struct() 'user_id' => array('UINT', 0), 'notification_read' => array('BOOL', 0), 'notification_time' => array('TIMESTAMP', 1), - 'data' => array('TEXT_UNI', ''), + 'notification_data' => array('TEXT_UNI', ''), ), 'PRIMARY_KEY' => 'notification_id', 'KEYS' => array( -- cgit v1.2.1 From b567e0963099b911e0d1d7b262c777a6969aad1f Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Thu, 31 Jan 2013 10:14:42 -0600 Subject: [ticket/11103] Remove Primary Key on user_notifications table PHPBB3-11103 --- phpBB/develop/create_schema_files.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index a280d3880a..6389ce7e7c 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1790,12 +1790,6 @@ function get_schema_struct() 'method' => array('VCHAR:255', ''), 'notify' => array('BOOL', 1), ), - 'PRIMARY_KEY' => array( - 'item_type', - 'item_id', - 'user_id', - 'method', - ), ); $schema_data['phpbb_user_group'] = array( -- cgit v1.2.1