[PR #54] [CLOSED] Foreign key change tries to drop empty named constraint #246

Closed
opened 2026-03-07 20:42:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/DBDiff/DBDiff/pull/54
Author: @berlinger-peussen
Created: 6/14/2017
Status: Closed

Base: masterHead: bugfix/change_constraint_renders_empty_name


📝 Commits (1)

  • 67ab3d1 When a foreign key constraint has to be changed, the old one is dropped, but without a name

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 src/SQLGen/DiffToSQL/AlterTableChangeConstraintSQL.php (+2 -2)

📄 Description

When DBDiff finds it needs to change a foreign key, it will create two statements, a drop and a add. The add is fine, but the drop is created without a name.

It will show up as ALTER TABLE `sometable` DROP CONSTRAINT ``;. This patch should fix the problem;


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/DBDiff/DBDiff/pull/54 **Author:** [@berlinger-peussen](https://github.com/berlinger-peussen) **Created:** 6/14/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `bugfix/change_constraint_renders_empty_name` --- ### 📝 Commits (1) - [`67ab3d1`](https://github.com/DBDiff/DBDiff/commit/67ab3d1ede63e915b26b34f505ee29b537028d5d) When a foreign key constraint has to be changed, the old one is dropped, but without a name ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/SQLGen/DiffToSQL/AlterTableChangeConstraintSQL.php` (+2 -2) </details> ### 📄 Description When DBDiff finds it needs to change a foreign key, it will create two statements, a drop and a add. The add is fine, but the drop is created without a name. It will show up as ```ALTER TABLE `sometable` DROP CONSTRAINT ``;```. This patch should fix the problem; --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-07 20:42:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DBDiff#246
No description provided.