Conflicts
A conflict is a signal to a user that a merge has produced a database that requires further action. The merge algorithm could not infer the state of the database based on the merge rules after the merge. Further input is required to tell Dolt what the resulting merged database should contain.
In Dolt, conflicts can occur on data and schema.
On data, conflicts are detected on a cell-level. If two operations modify the same row, column pair to be different values, a conflict is detected. Primary key values are used to identify rows across versions for the purpose of diff and merge.
In the case of keyless tables, every column is considered part of the primary key for merge. Thus, conflicts can only be generated in keyless tables if one side of the merge deletes a row and the other side adds the same row.
Two branches must add, delete or modify a similarly named table, column, foreign key, index or constraint to generate a schema conflict, otherwise the changes are mergeable.
If two branches modify the same named table, column, foreign key, index or check constraint, consult the following tables for conflict detection.
Left Branch | Right Branch | Caveat | Mergeable |
---|---|---|---|
Add t1 | Add t1 | Same Schema | Yes |
Add t1 | Add t1 | Different Schema | Schema Conflict |
Delete t1 | Delete t1 | | Yes |
Modify t1 | Delete t1 |