From 7692ec4456636f84092709fb7c5b38d22e4e4609 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 22 Jul 2024 15:24:00 +0100 Subject: [PATCH] Backport #51615 (#52215) Co-authored-by: Hafez Divandari --- .../Database/Schema/Grammars/SQLiteGrammar.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php index 201121cb6170..d3dfdebb6392 100755 --- a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php @@ -123,7 +123,7 @@ public function compileColumns($table) return sprintf( 'select name, type, not "notnull" as "nullable", dflt_value as "default", pk as "primary" ' .'from pragma_table_info(%s) order by cid asc', - $this->wrap(str_replace('.', '__', $table)) + $this->quoteString(str_replace('.', '__', $table)) ); } @@ -136,12 +136,12 @@ public function compileColumns($table) public function compileIndexes($table) { return sprintf( - 'select "primary" as name, group_concat(col) as columns, 1 as "unique", 1 as "primary" ' + 'select \'primary\' as name, group_concat(col) as columns, 1 as "unique", 1 as "primary" ' .'from (select name as col from pragma_table_info(%s) where pk > 0 order by pk, cid) group by name ' - .'union select name, group_concat(col) as columns, "unique", origin = "pk" as "primary" ' + .'union select name, group_concat(col) as columns, "unique", origin = \'pk\' as "primary" ' .'from (select il.*, ii.name as col from pragma_index_list(%s) il, pragma_index_info(il.name) ii order by il.seq, ii.seqno) ' .'group by name, "unique", "primary"', - $table = $this->wrap(str_replace('.', '__', $table)), + $table = $this->quoteString(str_replace('.', '__', $table)), $table ); } @@ -159,7 +159,7 @@ public function compileForeignKeys($table) .'group_concat("to") as foreign_columns, on_update, on_delete ' .'from (select * from pragma_foreign_key_list(%s) order by id desc, seq) ' .'group by id, "table", on_update, on_delete', - $this->wrap(str_replace('.', '__', $table)) + $this->quoteString(str_replace('.', '__', $table)) ); }