Database: Add support for `SPATIAL` keys to `dbDelta()`.

`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
This commit is contained in:
Gary Pendergast 2016-05-26 04:59:27 +00:00
parent 253686fae6
commit 0db17129a5
2 changed files with 5 additions and 1 deletions

View File

@ -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;
@ -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;

View File

@ -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.