diff options
author | Yorhel <git@yorhel.nl> | 2009-12-05 13:22:53 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-12-05 13:22:53 +0100 |
commit | 7554f305ae27091ccff6a692180a5af7282df766 (patch) | |
tree | e0c93d34c1748b4ad58040550665eb5427df156b /lib/VNDB/Handler/Producers.pm | |
parent | fbcadd3ceb50a97dab4dd5cd284cc35e8b89b3b4 (diff) |
Merged db[VN|Producer|Release][Edit|Add] into dbItemEdit and dbItemAdd
And also changed the way the item_table.latest column was updated: it is
now only updated after the revision insert has completed, making it
easier to write trigger functions in SQL.
Diffstat (limited to 'lib/VNDB/Handler/Producers.pm')
-rw-r--r-- | lib/VNDB/Handler/Producers.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm index e3473c3c..660c589e 100644 --- a/lib/VNDB/Handler/Producers.pm +++ b/lib/VNDB/Handler/Producers.pm @@ -188,8 +188,8 @@ sub edit { $rev = 1; my $npid = $pid; my $cid; - ($rev, $cid) = $self->dbProducerEdit($pid, %$frm) if $pid; - ($npid, $cid) = $self->dbProducerAdd(%$frm) if !$pid; + ($rev, $cid) = $self->dbItemEdit(p => $pid, %$frm) if $pid; + ($npid, $cid) = $self->dbItemAdd(p => %$frm) if !$pid; # update reverse relations if(!$pid && $#$relations >= 0 || $pid && $frm->{prodrelations} ne $b4{prodrelations}) { @@ -278,7 +278,7 @@ sub _updreverse { my $r = $self->dbProducerGet(id => $i, what => 'extended relations')->[0]; my @newrel = map $_->{id} != $pid ? [ $_->{relation}, $_->{id} ] : (), @{$r->{relations}}; push @newrel, [ $upd{$i}, $pid ] if $upd{$i}; - $self->dbProducerEdit($i, + $self->dbItemEdit(p => $i, relations => \@newrel, editsum => "Reverse relation update caused by revision p$pid.$rev", causedby => $cid, |