From 198b992dcef0a0a7099eb3db6185d567b58b6e5a Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Sun, 28 Apr 2013 22:53:05 -0500 Subject: [ticket/11413] Schema changes and migration file Notifications tables are dropped because phpBB currently does not have any way to make the necessary changes to the DB schema (and no release has yet been made with these changes). This will fix the following bugs: PHPBB3-11411 PHPBB3-11413 PHPBB3-11414 PHPBB3-11416 PHPBB3-11420 PHPBB3-11413 --- phpBB/develop/create_schema_files.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index b454fb2c16..3121db391d 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1317,16 +1317,20 @@ function get_schema_struct() $schema_data['phpbb_notification_types'] = array( 'COLUMNS' => array( - 'notification_type' => array('VCHAR:255', ''), + 'notification_type_id' => array('USINT', NULL, 'auto_increment'), + 'notification_type_name' => array('VCHAR:255', ''), 'notification_type_enabled' => array('BOOL', 1), ), - 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), + 'PRIMARY_KEY' => array('notification_type_id'), + 'KEYS' => array( + 'type' => array('UNIQUE', array('notification_type_name')), + ), ); $schema_data['phpbb_notifications'] = array( 'COLUMNS' => array( - 'notification_id' => array('UINT', NULL, 'auto_increment'), - 'item_type' => array('VCHAR:255', ''), + 'notification_id' => array('UINT:10', NULL, 'auto_increment'), + 'notification_type_id' => array('USINT', 0), 'item_id' => array('UINT', 0), 'item_parent_id' => array('UINT', 0), 'user_id' => array('UINT', 0), @@ -1336,7 +1340,7 @@ function get_schema_struct() ), 'PRIMARY_KEY' => 'notification_id', 'KEYS' => array( - 'item_ident' => array('INDEX', array('item_type', 'item_id')), + 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')), 'user' => array('INDEX', array('user_id', 'notification_read')), ), ); @@ -1814,12 +1818,12 @@ function get_schema_struct() ); $schema_data['phpbb_user_notifications'] = array( - 'COLUMNS' => array( - 'item_type' => array('VCHAR:255', ''), - 'item_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'method' => array('VCHAR:255', ''), - 'notify' => array('BOOL', 1), + 'COLUMNS' => array( + 'notification_type_id' => array('USINT', 0), + 'item_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'method' => array('VCHAR:255', ''), + 'notify' => array('BOOL', 1), ), ); -- cgit v1.2.1 From 33287a73609a99f33f3d0718fceaf72e39d5283e Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Mon, 29 Apr 2013 21:22:07 -0500 Subject: [ticket/11413] Undo editing the user_notifications table item_type is not equivalent to notification_type_name, it can be a generic string (typically used to be able to subscribe to multiple notification types while only subscribing to one item PHPBB3-11413 --- phpBB/develop/create_schema_files.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 3121db391d..0fd1a722ca 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1819,11 +1819,11 @@ function get_schema_struct() $schema_data['phpbb_user_notifications'] = array( 'COLUMNS' => array( - 'notification_type_id' => array('USINT', 0), - 'item_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'method' => array('VCHAR:255', ''), - 'notify' => array('BOOL', 1), + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'method' => array('VCHAR:255', ''), + 'notify' => array('BOOL', 1), ), ); -- cgit v1.2.1