diff --git a/apps/studio/components/interfaces/Database/Schemas/SchemaTableNode.tsx b/apps/studio/components/interfaces/Database/Schemas/SchemaTableNode.tsx index 68158f7ecda..0fcfd30767a 100644 --- a/apps/studio/components/interfaces/Database/Schemas/SchemaTableNode.tsx +++ b/apps/studio/components/interfaces/Database/Schemas/SchemaTableNode.tsx @@ -83,7 +83,7 @@ export const TableNode = memo(function TableNode({ if (over) { const overIndex = columns.findIndex((column) => column.id === over.id) const activeIndex = columns.findIndex((column) => column.id === active.id) - if (activeIndex !== overIndex) { + if (activeIndex >= 0 && overIndex >= 0 && activeIndex !== overIndex) { const newColumns = arrayMove(columns, activeIndex, overIndex) persistColumns(newColumns) }