Manage indexes and constraints
Inspect keys and indexes, create an index on an existing table, and review staged foreign-key changes with the correct engine and cancellation boundaries.
When to use this
Index lists ordinary and unique indexes, including some constraint-backed entries. Relations stages supported foreign-key changes. The relational Index buttons execute independently; primary/unique constraints and CHECK need their own definition and enforcement checks.
Use this to inspect access paths, add a supported index, prepare a single-column foreign key, or check whether declared relationships are actually enforced.
Before you start
Use an existing disposable demo table, confirm connection/database/Schema and DDL permissions, and keep the original definitions and a recovery copy. A foreign-key example also needs a compatible referenced key and valid existing data. Read the action boundaries before pressing OK, Delete Index or Execute.
Steps
- Select the intended existing table in the object tree and open Edit table structure; check the title and wait for metadata.
- Inspect Index → Name / Type / Fields / Unique and Relations → local/reference endpoints and actions. Check full server DDL for properties missing from the lists.
- For a relational index, review Add Index before OK or the selected row before Delete Index: both immediately attempt database operations without the parent SQL Preview.
- For a supported single-column foreign key, use Relations → Add, choose endpoints/name/actions, then return to the pending list. Delete stages removal; directly editing list text is not a saved-definition workflow.
- Use Save Changes directly for staged changes, review the full editable SQL Preview and choose Cancel or deliberate Execute. Stop if required DDL is absent or only comments are generated.
- Read the outcome, reopen the same target and compare actual metadata/DDL. Verify enforcement separately, and reload actual state before retrying a failed batch.
How to verify the result
A supported command can change the target only when accepted by the server. Confirm the resulting object, ordered columns, reference actions and enforcement/validation state through fresh metadata and the relevant server checks.
Troubleshooting
- No fields or indexes? Wait for loading, use Index Refresh and check the target, metadata permissions and load errors. Newly staged Fields rows are not existing server columns.
- Unique index refused? Check duplicate values, NULL/collation semantics and supported type/definition. A precheck is not a substitute for the server rule.
- Foreign-key creation refused? Check both endpoints and namespace, referenced key eligibility, compatible types, local nullability, existing values, storage engine, supported referential actions and privileges.
- A relationship still appears after Refresh? Refresh reloads server rows but does not clear pending additions/deletions. Use parent Discard and reopen to abandon the staged draft.
- The preview is comments only or lacks the intended constraint clause? Cancel. A success/close signal cannot turn missing DDL into a created constraint; prepare the required engine-specific operation separately.
- An index drop fails or a batch partly applies? Check constraint ownership/dependencies and fresh server state before retrying. Do not use parent Cancel as rollback.
Limits
- Relational Index Add/OK and Delete Index execute independently; parent Cancel/Discard cannot undo them. Relations additions/deletions are staged for the parent save. MongoDB indexes follow a separate staged path.
- The index form does not express every index property, and the relation form is single-column. There is no dedicated CHECK editor or universal primary/unique-constraint manager here.
- SQLite Relations add/drop currently produces rebuild guidance comments, not an implemented foreign-key change. Snowflake structure editing is unsupported and standard-table foreign keys are informational; Redis relational concepts are not applicable.
- Visible choices, a metadata row, diagram link, archived declaration, formatting message or closed dialog do not prove execution success, enforcement, atomic rollback or release acceptance.