Skip to content

Commit 8e428d1

Browse files
Merge pull request drizzle-team#3866 from WaciX/issue-3703
DROP INDEX does not include PG Schema prefix
2 parents 629b5aa + 4a4629c commit 8e428d1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drizzle-kit/src/sqlgenerator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3557,8 +3557,12 @@ class PgDropIndexConvertor extends Convertor {
35573557
}
35583558

35593559
convert(statement: JsonDropIndexStatement): string {
3560+
const { schema } = statement;
35603561
const { name } = PgSquasher.unsquashIdx(statement.data);
3561-
return `DROP INDEX "${name}";`;
3562+
3563+
const indexNameWithSchema = schema ? `"${schema}"."${name}"` : `"${name}"`;
3564+
3565+
return `DROP INDEX ${indexNameWithSchema};`;
35623566
}
35633567
}
35643568

0 commit comments

Comments
 (0)