'name' => 'forceforeign_fk_artist', 'index_name' => 'forceforeign_idx_artist',
'selftable' => 'forceforeign', 'foreigntable' => 'artist',
'selfcols' => ['artist'], 'foreigncols' => ['artistid'],
+ 'noindex' => 1,
on_delete => '', on_update => '', deferrable => 1,
},
],
my ($expected, $got) = @_;
my $desc = $expected->{display};
is( $got->name, $expected->{name},
- "name parameter correct for `$desc'" );
+ "name parameter correct for '$desc'" );
is( $got->on_delete, $expected->{on_delete},
- "on_delete parameter correct for `$desc'" );
+ "on_delete parameter correct for '$desc'" );
is( $got->on_update, $expected->{on_update},
- "on_update parameter correct for `$desc'" );
+ "on_update parameter correct for '$desc'" );
is( $got->deferrable, $expected->{deferrable},
- "is_deferrable parameter correct for `$desc'" );
+ "is_deferrable parameter correct for '$desc'" );
my $index = get_index( $got->table, { fields => $expected->{selfcols} } );
if ($expected->{noindex}) {
- ok( !defined $index, "index doesn't for `$desc'" );
+ ok( !defined $index, "index doesn't for '$desc'" );
} else {
- ok( defined $index, "index exists for `$desc'" );
- is( $index->name, $expected->{index_name}, "index has correct name for `$desc'" );
+ ok( defined $index, "index exists for '$desc'" );
+ is( $index->name, $expected->{index_name}, "index has correct name for '$desc'" );
}
}
my ($expected, $got) = @_;
my $desc = $expected->{display};
is( $got->name, $expected->{name},
- "name parameter correct for `$desc'" );
+ "name parameter correct for '$desc'" );
}
done_testing;
'Artwork' => -1,
'ForceForeign' => -1,
'LinerNotes' => -1,
+ 'TwoKeys' => -1, # TwoKeys has the index turned off on the rel def
};
{
my @indices = $table->get_indices;
my $index_count = scalar(@indices);
- $index_count++ if ($source_name eq 'TwoKeys'); # TwoKeys has the index turned off on the rel def
is($index_count, $fk_count, "correct number of indices for $source_name with no args");
for my $index (@indices) {
$fk_count += $idx_exceptions->{$source_name} || 0;
my @indices = $table->get_indices;
my $index_count = scalar(@indices);
- $index_count++ if ($source_name eq 'TwoKeys'); # TwoKeys has the index turned off on the rel def
is($index_count, $fk_count, "correct number of indices for $source_name with add_fk_index => 1");
}
}