Revision history for DBIx::Class
+
+ - Versioning refactored
+ - Row::insert will now not fall over if passed duplicate related objects
++
+ 0.08008 2007-11-16 14:30:00
+ - Fixed join merging bug (test from Zby)
- When adding relationships, it will throw an exception if you get the
foreign and self parts the wrong way round in the condition
- ResultSetColumn::func() now returns all results if called in list
RedHat systems from perl-5.8.8-10 and up that have the bless/overload
patch applied (badly) which causes 2x -> 100x performance penalty.
(Jon Schutz)
+ - ResultSource::reverse_relationship_info can distinguish between
+ sources using the same table
+ - Row::insert will now not fall over if passed duplicate related objects
+ - Row::copy will not fall over if you have two relationships to the
+ same source with a unique constraint on it
0.08007 2007-09-04 19:36:00
- patch for Oracle datetime inflation (abram@arin.net)
}
- foreach my $moniker (@monikers)
+ foreach my $moniker (sort @monikers)
{
my $source = $dbixschema->source($moniker);
$table->primary_key($source->primary_columns);
my @primary = $source->primary_columns;
+ foreach my $field (@primary) {
+ my $index = $table->add_index(
+ name => $field,
+ fields => [$field],
+ type => 'NORMAL',
+ );
+ }
my %unique_constraints = $source->unique_constraints;
foreach my $uniq (keys %unique_constraints) {
if (!$source->compare_relationship_keys($unique_constraints{$uniq}, \@primary)) {
name => "$uniq",
fields => $unique_constraints{$uniq}
);
+
+ my $index = $table->add_index(
+ name => $unique_constraints{$uniq}->[0],
+ fields => $unique_constraints{$uniq},
+ type => 'NORMAL',
+ );
+
}
}
my %created_FK_rels;
- foreach my $rel (@rels)
+ foreach my $rel (sort @rels)
{
my $rel_info = $source->relationship_info($rel);
# us to another table.
# OR: If is_foreign_key_constraint attr is explicity set (or set to false) on the relation
if ( ! exists $created_FK_rels{$rel_table}->{$key_test} &&
- ( exists $rel_info->{attrs}{is_foreign_key_constraint} &&
- $rel_info->{attrs}{is_foreign_key_constraint} ||
+ ( exists $rel_info->{attrs}{is_foreign_key_constraint} ?
+ $rel_info->{attrs}{is_foreign_key_constraint} :
!$source->compare_relationship_keys(\@keys, \@primary)
- )
+ )
)
{
$created_FK_rels{$rel_table}->{$key_test} = 1;
- $table->add_constraint(
- type => 'foreign_key',
- name => "fk_$keys[0]",
- fields => \@keys,
- reference_fields => \@refkeys,
- reference_table => $rel_table,
- on_delete => $on_delete,
- on_update => $on_update
- );
+ if (scalar(@keys)) {
+ $table->add_constraint(
+ type => 'foreign_key',
+ name => $table->name . "_fk_$keys[0]",
+ fields => \@keys,
+ reference_fields => \@refkeys,
+ reference_table => $rel_table,
+ on_delete => $on_delete,
+ on_update => $on_update
+ );
+
+ my $index = $table->add_index(
+ name => $keys[0],
+ fields => \@keys,
+ type => 'NORMAL',
+ );
+ }
+
}
}
}