Skip to content

Commit

Permalink
Merge pull request #3866 from WaciX/issue-3703
Browse files Browse the repository at this point in the history
DROP INDEX does not include PG Schema prefix
  • Loading branch information
AndriiSherman authored Jan 8, 2025
2 parents 629b5aa + 4a4629c commit 8e428d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drizzle-kit/src/sqlgenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3557,8 +3557,12 @@ class PgDropIndexConvertor extends Convertor {
}

convert(statement: JsonDropIndexStatement): string {
const { schema } = statement;
const { name } = PgSquasher.unsquashIdx(statement.data);
return `DROP INDEX "${name}";`;

const indexNameWithSchema = schema ? `"${schema}"."${name}"` : `"${name}"`;

return `DROP INDEX ${indexNameWithSchema};`;
}
}

Expand Down

0 comments on commit 8e428d1

Please sign in to comment.