Skip to content

Commit

Permalink
Merge pull request #104 from plank/fix-mysql-migration
Browse files Browse the repository at this point in the history
fix mysql migration
  • Loading branch information
frasmage committed Apr 29, 2024
2 parents d152c66 + 9e0a7c1 commit b59bd14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions migrations/2024_04_14_000000_add_meta_search_columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public function up()
if ($stringIndexLength > 0 && $driver = $this->detectDriverName()) {
if (in_array($driver, ['mysql', 'mariadb'])) {
$table->rawIndex(
"metable_type, key, value($stringIndexLength)",
"`metable_type`, `key`, `value`($stringIndexLength)",
'value_string_prefix_index'
);
} elseif (in_array($driver, ['pgsql', 'sqlite'])) {
$table->rawIndex(
"metable_type, key, SUBSTR(value, 1, $stringIndexLength)",
"`metable_type`, `key`, SUBSTR(`value`, 1, $stringIndexLength)",
'value_string_prefix_index'
);
}
Expand Down

0 comments on commit b59bd14

Please sign in to comment.