Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion drizzle-kit/src/serializer/mysqlSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,12 +862,16 @@ export const fromDatabase = async (
const tableSchema = idxRow['TABLE_SCHEMA'];
const tableName = idxRow['TABLE_NAME'];
const constraintName = idxRow['INDEX_NAME'];
const columnName: string = idxRow['COLUMN_NAME'];
const columnName: string | null = idxRow['COLUMN_NAME'];
const isUnique = idxRow['NON_UNIQUE'] === 0;

const tableInResult = result[tableName];
if (typeof tableInResult === 'undefined') continue;

// MySQL 8+ functional/expression indexes have COLUMN_NAME = NULL.
// Skip these since Drizzle doesn't support expression indexes yet.
if (columnName === null) continue;

// if (tableInResult.columns[columnName].type === "serial") continue;

indexesCount += 1;
Expand Down