Skip to content

Commit

Permalink
Database: Add support for SPATIAL keys to dbDelta().
Browse files Browse the repository at this point in the history
`dbDelta()` already supported spatial fields (by virtue of not checking field types), so it's nice to round that out with spatial key support, too.

Fixes #36948.


Built from https://develop.svn.wordpress.org/trunk@37574


git-svn-id: http://core.svn.wordpress.org/trunk@37542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
pento committed May 26, 2016
1 parent 253686f commit 0db1712
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions wp-admin/includes/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2200,6 +2200,7 @@ function dbDelta( $queries = '', $execute = true ) {
case 'fulltext':
case 'unique':
case 'key':
case 'spatial':
$validfield = false;
$indices[] = trim(trim($fld), ", \n");
break;
Expand Down Expand Up @@ -2301,6 +2302,9 @@ function dbDelta( $queries = '', $execute = true ) {
if ( 'FULLTEXT' === strtoupper( $index_data['index_type'] ) ) {
$index_string .= 'FULLTEXT ';
}
if ( 'SPATIAL' === strtoupper( $index_data['index_type'] ) ) {
$index_string .= 'SPATIAL ';
}
$index_string .= 'KEY ';
if ($index_name != 'PRIMARY') {
$index_string .= $index_name;
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37573';
$wp_version = '4.6-alpha-37574';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 0db1712

Please sign in to comment.