Skip to content

Commit

Permalink
bugfix: Fix a bug that caused output without specifying index name
Browse files Browse the repository at this point in the history
  • Loading branch information
Karibash committed Aug 1, 2024
1 parent d65afd3 commit a591ad3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drizzle-kit/src/introspect-mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
PrimaryKey,
UniqueConstraint,
} from './serializer/mysqlSchema';
import { indexName } from './serializer/mysqlSerializer';

// time precision to fsp
// {mode: "string"} for timestamp by default
Expand Down Expand Up @@ -768,12 +767,9 @@ const createTableIndexes = (

idxKey = casing(idxKey);

const indexGeneratedName = indexName(tableName, it.columns);
const escapedIndexName = indexGeneratedName === it.name ? '' : `"${it.name}"`;

statement += `\t\t${idxKey}: `;
statement += it.isUnique ? 'uniqueIndex(' : 'index(';
statement += `${escapedIndexName})`;
statement += `"${it.name}")`;
statement += `.on(${
it.columns
.map((it) => `table.${casing(it)}`)
Expand Down

0 comments on commit a591ad3

Please sign in to comment.