【发布时间】:2019-11-08 06:12:09
【问题描述】:
我的表中有一个case-insensitive 排序规则列。
col_name : hash_id, collation : utf8mb4_unicode_ci
当我只搜索前者时,我得到了yA2JeGs 和YA2JeGs 的结果。
所以我需要更新排序规则以确保该列的case-sensitivity。
我尝试更改该列的排序规则,创建一个新的migration 文件:
public function up()
{
Schema::table('product_match_unmatches', function (Blueprint $table) {
$table->string('hash_id')->collate('utf8mb4_bin')->change();
});
}
还有$table->string('hash_id')->collation('utf8mb4_bin')->change();
迁移成功运行,但排序规则保持不变。
我如何在 laravel 中做到这一点?
【问题讨论】:
标签: php mysql laravel collation utf8mb4