aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2013-05-20 11:54:39 -0400
committerDavid King <imkingdavid@gmail.com>2013-05-20 11:54:39 -0400
commitfedd9d18d2ab2c06fd584f599e685014783b9655 (patch)
tree352ca31c2a003d91a0101176c8ab92ca1021dcb0 /phpBB/includes/db
parent9fab868f0f0a420b4eb7efb42e9c4cf27e66e9b3 (diff)
parent05cd045923068b08962856ec5e0c36f72f8f831c (diff)
downloadforums-fedd9d18d2ab2c06fd584f599e685014783b9655.tar
forums-fedd9d18d2ab2c06fd584f599e685014783b9655.tar.gz
forums-fedd9d18d2ab2c06fd584f599e685014783b9655.tar.bz2
forums-fedd9d18d2ab2c06fd584f599e685014783b9655.tar.xz
forums-fedd9d18d2ab2c06fd584f599e685014783b9655.zip
Merge remote-tracking branch 'EXreaction/ticket/11413' into develop
* EXreaction/ticket/11413: (23 commits) [ticket/11413] Revert some cache service related changes from earlier [ticket/11413] Use phpbb_user in test [ticket/11413] $user should have been $this->user [ticket/11413] Fix unit tests [ticket/11413] Translate the error [ticket/11413] Rename file to something more helpful [ticket/11413] Remove remaining irrelevant code to this PR [ticket/11413] Remove mock sql_insert_buffer.php (not relevant to PR) [ticket/11413] Remove conversion of user_notifications [ticket/11413] Correct copyright year [ticket/11413] Remove changes for ticket 11420 from this branch [ticket/11413] Include mock class [ticket/11413] Don't use the database for the convert test [ticket/11413] Test get_notification_type_id and _ids functions [ticket/11413] Use sql_insert_buffer [ticket/11413] Create test for notification conversion [ticket/11413] Fix test fixtures and tests [ticket/11413] Fix some more tests [ticket/11413] Fix notification tests [ticket/11413] Prevent recursive function calls ...
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r--phpBB/includes/db/migration/data/310/notifications_schema_fix.php92
1 files changed, 92 insertions, 0 deletions
diff --git a/phpBB/includes/db/migration/data/310/notifications_schema_fix.php b/phpBB/includes/db/migration/data/310/notifications_schema_fix.php
new file mode 100644
index 0000000000..27e63e10d0
--- /dev/null
+++ b/phpBB/includes/db/migration/data/310/notifications_schema_fix.php
@@ -0,0 +1,92 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+class phpbb_db_migration_data_310_notifications_schema_fix extends phpbb_db_migration
+{
+ static public function depends_on()
+ {
+ return array('phpbb_db_migration_data_310_notifications');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'notification_types',
+ $this->table_prefix . 'notifications',
+ ),
+ 'add_tables' => array(
+ $this->table_prefix . 'notification_types' => array(
+ 'COLUMNS' => array(
+ '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_id'),
+ 'KEYS' => array(
+ 'type' => array('UNIQUE', array('notification_type_name')),
+ ),
+ ),
+ $this->table_prefix . 'notifications' => array(
+ 'COLUMNS' => array(
+ '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),
+ 'notification_read' => array('BOOL', 0),
+ 'notification_time' => array('TIMESTAMP', 1),
+ 'notification_data' => array('TEXT_UNI', ''),
+ ),
+ 'PRIMARY_KEY' => 'notification_id',
+ 'KEYS' => array(
+ 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')),
+ 'user' => array('INDEX', array('user_id', 'notification_read')),
+ ),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_tables' => array(
+ $this->table_prefix . 'notification_types',
+ $this->table_prefix . 'notifications',
+ ),
+ 'add_tables' => array(
+ $this->table_prefix . 'notification_types' => array(
+ 'COLUMNS' => array(
+ 'notification_type' => array('VCHAR:255', ''),
+ 'notification_type_enabled' => array('BOOL', 1),
+ ),
+ 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'),
+ ),
+ $this->table_prefix . '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),
+ 'notification_read' => array('BOOL', 0),
+ 'notification_time' => array('TIMESTAMP', 1),
+ 'notification_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', 'notification_read')),
+ ),
+ ),
+ ),
+ );
+ }
+}