Depending on the presence of a third field DBDiff detects or not the difference in the second field.
Step to reproduce
1°) Create the a11_elements and a12_elements tables in two databases
2°) In database2, change a value
3°) Run DBDiff
1°)
CREATE TABLE a11_elements (
id int(6) NOT NULL,
show_in_list_summary int(1) DEFAULT NULL,
filter_exact_match int(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO a11_elements (id, show_in_list_summary, filter_exact_match) VALUES(646, 1, NULL);
ALTER TABLE a11_elements ADD PRIMARY KEY (id);
CREATE TABLE a12_elements (
id int(6) NOT NULL,
show_in_list_summary int(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO a12_elements (id, show_in_list_summary) VALUES (646, 1);
ALTER TABLE a12_elements ADD PRIMARY KEY (id);
2°)
database2.a11_elements.show_in_list_summary=0
database2.a12_elements.show_in_list_summary=0
3°)
php dbdiff --server1=root:root@localhost:3306 --type=data --include=all server1.database1.a11_elements:server1.database2.a11_elements --output=dbdiff_database1to2.sql
Results :
Now calculating data diff for table a11_elements
Identical resources
Completed
php dbdiff --server1=root:root@localhost:3306 --type=data --include=all server1.database1.a12_elements:server1.database2.a12_elements --output=dbdiff_database1to2.sql
Results :
Now calculating data diff for table a12_elements
Now generating UP migration
Now generating DOWN migration
Writing migration file to dbdiff_database1to2.sql
Completed
---------- UP ----------
UPDATE a12_elements SET show_in_list_summary = '0' WHERE id = '646';
---------- DOWN ----------
UPDATE a12_elements SET show_in_list_summary = '1' WHERE id = '646';
Conclusion: With the same context for the first two fields (646 on both databases and respectively 1 / 0 on each database), only when deleting the third field DBDiff detects the difference in the second field.
Depending on the presence of a third field DBDiff detects or not the difference in the second field.
Step to reproduce
1°) Create the a11_elements and a12_elements tables in two databases
2°) In database2, change a value
3°) Run DBDiff
1°)
CREATE TABLE
a11_elements(idint(6) NOT NULL,show_in_list_summaryint(1) DEFAULT NULL,filter_exact_matchint(1) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO
a11_elements(id,show_in_list_summary,filter_exact_match) VALUES(646, 1, NULL);ALTER TABLE
a11_elementsADD PRIMARY KEY (id);CREATE TABLE
a12_elements(idint(6) NOT NULL,show_in_list_summaryint(1) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO
a12_elements(id,show_in_list_summary) VALUES (646, 1);ALTER TABLE
a12_elementsADD PRIMARY KEY (id);2°)
database2.a11_elements.
show_in_list_summary=0database2.a12_elements.
show_in_list_summary=03°)
php dbdiff --server1=root:root@localhost:3306 --type=data --include=all server1.database1.a11_elements:server1.database2.a11_elements --output=dbdiff_database1to2.sql
Results :
php dbdiff --server1=root:root@localhost:3306 --type=data --include=all server1.database1.a12_elements:server1.database2.a12_elements --output=dbdiff_database1to2.sql
Results :
---------- UP ----------
UPDATE
a12_elementsSETshow_in_list_summary= '0' WHEREid= '646';---------- DOWN ----------
UPDATE
a12_elementsSETshow_in_list_summary= '1' WHEREid= '646';Conclusion: With the same context for the first two fields (646 on both databases and respectively 1 / 0 on each database), only when deleting the third field DBDiff detects the difference in the second field.