use DBIx::Class::Schema::Loader::Utils qw/split_name slurp_file array_eq/;
use Try::Tiny;
use List::Util 'first';
-use List::MoreUtils qw/apply uniq any/;
+use List::MoreUtils qw/apply uniq any none/;
use namespace::clean;
use Lingua::EN::Inflect::Phrase ();
use Lingua::EN::Tagger ();
# make a copy to destroy
my @tables = @$tables;
+ my %uniq_cols = map { $_->[0] => [ map { $_->[1] } @{$_->[2]} ] } @tables;
my $all_code = {};
$remote_moniker, $remote_cols, $remote_relname,
);
+ if (!$self->loader->_disable_uniq_detection
+ && none { array_eq($_, $remote_cols) }
+ [ $remote_obj->primary_columns ],
+ @{$uniq_cols{$remote_moniker}},
+ ) {
+ warn <<"EOF";
+$local_method relationship '$remote_relname' in source '$local_moniker' references
+non-unique columns (@{[join(',', @$remote_cols)]}) in source '$remote_moniker'.
+EOF
+ }
+
my $rel_attrs_params = {
rel_name => $local_relname,
rel_type => $local_method,