Skip to content

Commit

Permalink
Change default table collation from utf8_general_ci to utf8mb4_unicod…
Browse files Browse the repository at this point in the history
…e_ci
  • Loading branch information
odan committed Sep 22, 2023
1 parent 1fb309f commit 0389b3a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ private function getPhinxTableEncoding(array $attributes, array $table): array
if (!empty($table['table']['character_set_name'])) {
$attributes['encoding'] = $table['table']['character_set_name'];
} else {
$attributes['encoding'] = 'utf8';
$attributes['encoding'] = 'utf8mb4';
}

return $attributes;
}

/**
* Define table collation (defaults to `utf8_general_ci`).
* Define table collation (defaults to `utf8mb4_unicode_ci`).
*
* @param array $attributes The attributes
* @param array $table The table
Expand All @@ -146,7 +146,7 @@ private function getPhinxTableCollation(array $attributes, array $table): array
if (!empty($table['table']['table_collation'])) {
$attributes['collation'] = $table['table']['table_collation'];
} else {
$attributes['collation'] = 'utf8_general_ci';
$attributes['collation'] = 'utf8mb4_unicode_ci';
}

return $attributes;
Expand Down

0 comments on commit 0389b3a

Please sign in to comment.