Skip to content

Disable Apply when the designer fails to load: it sends CREATE TABLE orders () #796

Closed

Description

@EVWorth

Severity: P1 (data safety / misleading)

What happens

  1. Open ?mock=connected. In devtools, wrap window.__TAURI_INTERNALS__.invoke so that get_foreign_keys rejects with an error string (for example a permissions error on information_schema).
  2. Right-click shop > Tables > orders and pick Design Table.
  3. The header shows "Failed to load table structure: …" in red. The error text squeezes the header, so "Preview SQL" and "Apply Changes" wrap. Below it is a blank form with one unnamed INT column, and Apply Changes is still enabled.
  4. Preview SQL shows CREATE TABLE \orders` ( ) ENGINE = InnoDB …`.
  5. Apply Changes sends that statement and reports "Table saved successfully!" (the mock accepts it; a real server rejects it).

Cause

  • src/components/designer/TableDesigner.tsx:196 loads columns, indexes, foreign keys and DDL with Promise.all, so one failed read empties the whole form.
  • originalConfig then stays null, and generateSql (:291-294) falls back to generateCreateTable even though the tab is in alter mode.
  • runSave (:326) clears the load error before it runs.

Fix

  • Use Promise.allSettled and keep what did load, as TableStructure.tsx:72 does.
  • If columns or DDL fail, show a full-panel error with Retry and disable Apply and Preview.
  • Never generate CREATE TABLE while tableName is set.

Part of #783.

Activity

  1. added
    bug
    on Oct 21, 2026
  2. added a commit that references this issue on Oct 21, 2026
    b1063c6
  3. added a commit that references this issue on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions