Updated changelog and tests

This commit is contained in:
Carlos Salguero
2019-09-06 06:25:52 -03:00
parent 9190b5e6ac
commit ed6ebcedbd
10 changed files with 112 additions and 71 deletions

View File

@@ -52,17 +52,23 @@ $sb->load_file('master', "$sample/long_fk_constraints.sql");
warn $output;
my $constraints = $master_dbh->selectall_arrayref("SELECT TABLE_NAME, CONSTRAINT_NAME FROM information_schema.KEY_COLUMN_USAGE WHERE table_schema='bug1215587' and (TABLE_NAME='Table1' OR TABLE_NAME='Table2') and CONSTRAINT_NAME LIKE '%fkey%' ORDER BY TABLE_NAME, CONSTRAINT_NAME");
warn Data::Dumper::Dumper($constraints);
my $query = <<_SQL;
SELECT TABLE_NAME, CONSTRAINT_NAME
FROM information_schema.KEY_COLUMN_USAGE
WHERE table_schema='bug1215587'
and (TABLE_NAME='Table1' OR TABLE_NAME='Table2')
and CONSTRAINT_NAME LIKE '%fkey%'
ORDER BY TABLE_NAME, CONSTRAINT_NAME
_SQL
my $constraints = $master_dbh->selectall_arrayref($query);
is_deeply(
$constraints,
[
[ 'Table1', '__fkey1a' ],
[ 'Table1', '__fkey_SALES_RECURRING_PROFILE_CUSTOMER_CUSTOMER_ENTITY_ENTITY_I' ],
[ 'Table2', '__fkey2b' ],
[ 'Table2', '_fkey2a' ],
[ 'Table2', '__fkey2b' ]
],
"First run adds or removes underscore from constraint names, accordingly"
);