Skip to content

Merge auto-generated keys when diffing tables #57

@Zatnosk

Description

@Zatnosk

Creating a foreign key without a backing key makes the database auto-generate a relevant backing key.

DBTool can't recognize that these two are related and reports differences from file structure.

Minimal example:

CREATE TABLE `table_b` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `table_a` (
	`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
	`b_id` int(10) unsigned NOT NULL,
	PRIMARY KEY (`id`),
	FOREIGN KEY (`b_id`) REFERENCES `table_b` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions