Skip to content

Commit

Permalink
increased index size for capability.capability to 100
Browse files Browse the repository at this point in the history
  • Loading branch information
itthinx committed Apr 22, 2015
1 parent 5e69de0 commit 1b02e19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
* Plugin Name: Groups
* Plugin URI: http://www.itthinx.com/plugins/groups
* Description: Groups provides group-based user membership management, group-based capabilities and content access control.
* Version: 1.5.0
* Version: 1.5.1
* Author: itthinx
* Author URI: http://www.itthinx.com
* Donate-Link: http://www.itthinx.com
* License: GPLv3
*/
define( 'GROUPS_CORE_VERSION', '1.5.0' );
define( 'GROUPS_CORE_VERSION', '1.5.1' );
define( 'GROUPS_FILE', __FILE__ );
if ( !defined( 'GROUPS_CORE_DIR' ) ) {
define( 'GROUPS_CORE_DIR', WP_PLUGIN_DIR . '/groups' );
Expand Down
6 changes: 3 additions & 3 deletions lib/core/class-groups-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class VARCHAR(255) DEFAULT NULL,
name VARCHAR(100) DEFAULT NULL,
description LONGTEXT DEFAULT NULL,
PRIMARY KEY (capability_id),
UNIQUE INDEX capability (capability(20)),
UNIQUE INDEX capability (capability(100)),
INDEX capability_kco (capability(20),class(20),object(20))
) $charset_collate;";
}
Expand Down Expand Up @@ -270,9 +270,9 @@ public static function update( $previous_version ) {
Groups_Options::update_option( Groups_Post_Access::READ_POST_CAPABILITIES, array( Groups_Post_Access::READ_POST_CAPABILITY ) );
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_value = %s WHERE meta_key = %s", Groups_Post_Access::READ_POST_CAPABILITY, Groups_Post_Access::POSTMETA_PREFIX . Groups_Post_Access::READ_POST_CAPABILITY ) );
}
if ( strcmp( $previous_version, '1.5.0' ) < 0 ) {
if ( strcmp( $previous_version, '1.5.1' ) < 0 ) {
$capability_table = _groups_get_tablename( 'capability' );
$queries[] = "ALTER TABLE $capability_table DROP INDEX capability, ADD UNIQUE INDEX capability(capability(20));";
$queries[] = "ALTER TABLE $capability_table DROP INDEX capability, ADD UNIQUE INDEX capability(capability(100));";
}
}
} // switch
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ See also [Groups](http://www.itthinx.com/plugins/groups/)

== Changelog ==

= 1.5.1 =
* Please **MAKE A BACKUP** of your site and database PRIOR to updating.
* WordPress 4.2 compatible.
* Adopted a more flexible index size on the capability row of the capability table.

= 1.5.0 =
* Please **MAKE A BACKUP** of your site and database PRIOR to updating.
* WordPress 4.2 compatible.
Expand Down Expand Up @@ -430,6 +435,6 @@ Some installations wouldn't work correctly, showing no capabilities and making i

== Upgrade Notice ==

= 1.5.0 =
= 1.5.1 =
Please **MAKE A BACKUP** of your site and database PRIOR to updating.
This release is required for compatibility with WordPress 4.2 and above (uses a reduced index size on a database table).

0 comments on commit 1b02e19

Please sign in to comment.