diff --git a/lib/db/install.xml b/lib/db/install.xml index 518e8518e14..0ecd779be35 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -2959,7 +2959,6 @@ - diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index ad1e596e5df..f1e5d2382fe 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -3669,5 +3669,15 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2014051200.06); } + if ($oldversion < 2014051201.03) { + $table = new xmldb_table('user_devices'); + $oldindex = new xmldb_index('pushid-platform', XMLDB_KEY_UNIQUE, array('pushid', 'platform')); + if ($dbman->index_exists($table, $oldindex)) { + $key = new xmldb_key('pushid-platform', XMLDB_KEY_UNIQUE, array('pushid', 'platform')); + $dbman->drop_key($table, $key); + } + upgrade_main_savepoint(true, 2014051201.03); + } + return true; } diff --git a/user/externallib.php b/user/externallib.php index 24daf4f60bb..7b298e81877 100644 --- a/user/externallib.php +++ b/user/externallib.php @@ -1119,16 +1119,6 @@ class core_user_external extends external_api { return $warnings; } - // The same key can't exists for the same platform. - if ($DB->get_record('user_devices', array('pushid' => $params['pushid'], 'platform' => $params['platform']))) { - $warnings['warning'][] = array( - 'item' => $params['pushid'], - 'warningcode' => 'existingkeyforplatform', - 'message' => 'This key is already stored for other device using the same platform' - ); - return $warnings; - } - $userdevice = new stdclass; $userdevice->userid = $USER->id; $userdevice->appid = $params['appid']; diff --git a/version.php b/version.php index fdcd7383f21..4b8791d78eb 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2014051201.02; // 20140512 = branching date YYYYMMDD - do not modify! +$version = 2014051201.03; // 20140512 = branching date YYYYMMDD - do not modify! // RR = release increments - 00 in DEV branches. // .XX = incremental changes.