Skip to content

Commit

Permalink
Merge pull request #87 from humanmade/use-default-charset-collate
Browse files Browse the repository at this point in the history
Use WordPress default charset collate instead of database server
  • Loading branch information
rmccue authored Nov 4, 2019
2 parents 2495799 + 758b092 commit 87cae62
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ function is_installed() {

function create_tables() {
global $wpdb;

$charset_collate = $wpdb->get_charset_collate();

$query = "CREATE TABLE IF NOT EXISTS `{$wpdb->base_prefix}cavalcade_jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`site` bigint(20) unsigned NOT NULL,
Expand All @@ -77,7 +80,7 @@ function create_tables() {
PRIMARY KEY (`id`),
KEY `status` (`status`)
) ENGINE=InnoDB;\n";
) ENGINE=InnoDB {$charset_collate};\n";

// TODO: check return value
$wpdb->query( $query );
Expand All @@ -91,7 +94,7 @@ function create_tables() {
PRIMARY KEY (`id`),
KEY `job` (`job`),
KEY `status` (`status`)
) ENGINE=InnoDB;\n";
) ENGINE=InnoDB {$charset_collate};\n";

$wpdb->query( $query );

Expand Down

0 comments on commit 87cae62

Please sign in to comment.