mirror of
https://github.com/withastro/astro.git
synced 2025-03-17 23:11:29 -05:00
fix: escape name on drop table
This commit is contained in:
parent
bab9871dad
commit
30cf903fe0
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ export async function recreateTables({
|
|||
}) {
|
||||
const setupQueries: SQL[] = [];
|
||||
for (const [name, collection] of Object.entries(collections)) {
|
||||
const dropQuery = sql.raw(`DROP TABLE IF EXISTS ${name}`);
|
||||
const dropQuery = sql.raw(`DROP TABLE IF EXISTS ${sqlite.escapeName(name)}`);
|
||||
const createQuery = sql.raw(getCreateTableQuery(name, collection));
|
||||
const indexQueries = getCreateIndexQueries(name, collection);
|
||||
setupQueries.push(dropQuery, createQuery, ...indexQueries.map((s) => sql.raw(s)));
|
||||
|
|
Loading…
Add table
Reference in a new issue