Skip to content

Fix: implement missing onOk handler to download migration zip#960

Merged
1ilit merged 2 commits intodrawdb-io:mainfrom
mdzpaulina:fix-migrations-confirm-button
Mar 26, 2026
Merged

Fix: implement missing onOk handler to download migration zip#960
1ilit merged 2 commits intodrawdb-io:mainfrom
mdzpaulina:fix-migrations-confirm-button

Conversation

@mdzpaulina
Copy link
Contributor

Description

Resolves #956

This PR fixes the bug where the "Confirm" button on the Migrations (Beta) modal was unresponsive, preventing users from downloading their generated SQL migration scripts.

Solution

The issue occurred because the Semi UI <Modal> component was missing the onOk event handler.

To fix this:

  • Imported JSZip and file-saver in Migration.jsx.
  • Implemented a handleConfirm function that packages the up.sql and down.sql scripts into a .zip blob and triggers the download.
  • Used JSZip.default || JSZip instantiation to ensure compatibility with Vite's module bundling and prevent TypeError: JSZip is not a constructor.
  • Attached the handleConfirm function to the onOk prop of the Modal.

Evidence:
Captura de pantalla 2026-03-25 a la(s) 11 56 13 a m

Add handleConfirm function to generate and download the zip file using JSZip. Attach the handler to the onOk prop of the Modal.

Resolves drawdb-io#956
@vercel
Copy link

vercel bot commented Mar 25, 2026

@mdzpaulina is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drawdb Ready Ready Preview, Comment Mar 26, 2026 7:52am

Copy link
Member

@1ilit 1ilit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching this!

@1ilit 1ilit merged commit f6867c3 into drawdb-io:main Mar 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 'Confirm' button on Migrations export modal does nothing (Beta Feature)

2 participants