phpmyadmin / phpmyadmin/phpmyadmin

"Online"/Instant Foreign Key updates

Open
#18,062 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement
Dominant language
PHP
Stars
7.9k
Forks
3.6k
Avg merge
4d 18h
Merged PRs (30d)
36

Description

Hey

It would be nice if we had a "Enable foreign key checks" checkbox in this screen here.

The reason is that if I am updating existing foreign keys, for example, from "CASCADE" to "RESTRICT",
I don't want the query to take a long time to run the two ALTER TABLE this edit generates.

If we disable FK checks, the ALTER TABLEs will run instantly/online.

Otherwise, it locks all the tables involved and the website goes down due to critical tables being locked.

What I'm doing at the moment is "Preview SQL" and then run it in the SQL tab with FK checks disabled. It's a few manual steps.

Thanks!

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the screen shown in the issue and trace the existing Preview SQL flow and the SQL tab execution path. Determine where the proposed checkbox should affect foreign-key checks around the generated ALTER TABLE statements; done means the option is available in that screen and the generated updates can run with checks disabled without requiring the current manual steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
mariadb, mysql, php
Domain
databases, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.