From cd35486230349a87ed89b57beefff7c2284f4c3c Mon Sep 17 00:00:00 2001 From: jxlwqq Date: Tue, 4 Aug 2020 15:00:59 +0800 Subject: [PATCH] Add backtick (`) in SQL --- src/Console/GenerateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/GenerateCommand.php b/src/Console/GenerateCommand.php index 57f814e..c417ad9 100644 --- a/src/Console/GenerateCommand.php +++ b/src/Console/GenerateCommand.php @@ -369,7 +369,7 @@ public static function enumValues($table, $name) return "[]"; } - $type = DB::select(DB::raw('SHOW COLUMNS FROM ' . $table . ' WHERE Field = "' . $name . '"'))[0]->Type; + $type = DB::select(DB::raw('SHOW COLUMNS FROM `' . $table . '` WHERE Field = "' . $name . '"'))[0]->Type; preg_match_all("/'([^']+)'/", $type, $matches);