Skip to content

Commit 7692ec4

Browse files
Backport #51615 (#52215)
Co-authored-by: Hafez Divandari <[email protected]>
1 parent 96712ba commit 7692ec4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function compileColumns($table)
123123
return sprintf(
124124
'select name, type, not "notnull" as "nullable", dflt_value as "default", pk as "primary" '
125125
.'from pragma_table_info(%s) order by cid asc',
126-
$this->wrap(str_replace('.', '__', $table))
126+
$this->quoteString(str_replace('.', '__', $table))
127127
);
128128
}
129129

@@ -136,12 +136,12 @@ public function compileColumns($table)
136136
public function compileIndexes($table)
137137
{
138138
return sprintf(
139-
'select "primary" as name, group_concat(col) as columns, 1 as "unique", 1 as "primary" '
139+
'select \'primary\' as name, group_concat(col) as columns, 1 as "unique", 1 as "primary" '
140140
.'from (select name as col from pragma_table_info(%s) where pk > 0 order by pk, cid) group by name '
141-
.'union select name, group_concat(col) as columns, "unique", origin = "pk" as "primary" '
141+
.'union select name, group_concat(col) as columns, "unique", origin = \'pk\' as "primary" '
142142
.'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) '
143143
.'group by name, "unique", "primary"',
144-
$table = $this->wrap(str_replace('.', '__', $table)),
144+
$table = $this->quoteString(str_replace('.', '__', $table)),
145145
$table
146146
);
147147
}
@@ -159,7 +159,7 @@ public function compileForeignKeys($table)
159159
.'group_concat("to") as foreign_columns, on_update, on_delete '
160160
.'from (select * from pragma_foreign_key_list(%s) order by id desc, seq) '
161161
.'group by id, "table", on_update, on_delete',
162-
$this->wrap(str_replace('.', '__', $table))
162+
$this->quoteString(str_replace('.', '__', $table))
163163
);
164164
}
165165

0 commit comments

Comments
 (0)