Commit ad77b22e authored by John James Jacoby's avatar John James Jacoby
Browse files

Update database schema and docs.

parent af13de5d
......@@ -3,7 +3,7 @@ Contributors: johnjamesjacoby, stuttter
Tags: users, signups, admin, multisite
Requires at least: 4.7
Tested up to: 4.8
Stable tag: 3.0.0
Stable tag: 4.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9Q4F4EL5YJ62J
......@@ -82,6 +82,9 @@ http://github.com/stuttter/wp-user-signups
== Changelog ==
= [4.0.0] - 2017-04-11 =
* Database schema update
= [3.1.0] - 2017-04-03 =
* Signup meta support
......
......@@ -24,7 +24,7 @@ final class WP_DB_Table_Signupmeta extends WP_DB_Table {
/**
* @var string Database version
*/
protected $version = 201704030001;
protected $version = 201704110001;
/**
* @var boolean This is a global table
......@@ -38,8 +38,8 @@ final class WP_DB_Table_Signupmeta extends WP_DB_Table {
*/
protected function set_schema() {
$max_index_length = 191;
$this->schema = "meta_id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
signup_id bigint(20) NOT NULL,
$this->schema = "meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
signup_id bigint(20) unsigned NOT NULL default '0',
meta_key varchar(255) DEFAULT NULL,
meta_value longtext DEFAULT NULL,
KEY signup_id (signup_id),
......@@ -53,5 +53,10 @@ final class WP_DB_Table_Signupmeta extends WP_DB_Table {
*/
protected function upgrade() {
// 3.0.0 to 4.0.0
if ( version_compare( (int) $this->db_version, 201704110001, '<=' ) ) {
$this->db->query( "ALTER TABLE {$this->table_name} MODIFY `meta_id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;" );
$this->db->query( "ALTER TABLE {$this->table_name} MODIFY `signup_id` BIGINT(20) unsigned NOT NULL default 0;" );
}
}
}
......@@ -24,7 +24,7 @@ final class WP_DB_Table_Signups extends WP_DB_Table {
/**
* @var string Database version
*/
protected $version = 201704030001;
protected $version = 201704110001;
/**
* @var boolean This is a global table
......@@ -37,7 +37,7 @@ final class WP_DB_Table_Signups extends WP_DB_Table {
* @since 2.0.0
*/
protected function set_schema() {
$this->schema = "signup_id bigint(20) NOT NULL auto_increment,
$this->schema = "signup_id bigint(20) unsigned NOT NULL auto_increment,
domain varchar(200) NOT NULL default '',
path varchar(100) NOT NULL default '',
title longtext NOT NULL,
......@@ -62,5 +62,9 @@ final class WP_DB_Table_Signups extends WP_DB_Table {
*/
protected function upgrade() {
// 3.0.0 to 4.0.0
if ( version_compare( (int) $this->db_version, 201704110001, '<=' ) ) {
$this->db->query( "ALTER TABLE {$this->table_name} MODIFY `signup_id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;" );
}
}
}
......@@ -8,7 +8,7 @@
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Description: Signup management for WordPress
* Version: 3.1.0
* Version: 4.0.0
* Text Domain: wp-signups
* Domain Path: /wp-user-signups/assets/languages/
*/
......@@ -99,5 +99,5 @@ function wp_signups_get_plugin_url() {
* @return int
*/
function wp_signups_get_asset_version() {
return 201704030001;
return 201704110001;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment