diff options
author | Yorhel <git@yorhel.nl> | 2010-01-01 15:12:32 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2010-01-01 15:12:32 +0100 |
commit | 0a4395eb4b186ea91e7a69d1556cb50352ade7f7 (patch) | |
tree | 649cbb8a071d65eda7b54a2305727b90bcc4ab16 /lib/VNDB/DB/Misc.pm | |
parent | f146569cc560d64cf91e4386e3291fb45fa90c88 (diff) |
SQL: Revision insertion abstraction for release entries
Also added a little sanity checking on the edit_(vn|release) table,
and added a default value for releases_rev.released.
Diffstat (limited to 'lib/VNDB/DB/Misc.pm')
-rw-r--r-- | lib/VNDB/DB/Misc.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/VNDB/DB/Misc.pm b/lib/VNDB/DB/Misc.pm index b1f79705..4b14d485 100644 --- a/lib/VNDB/DB/Misc.pm +++ b/lib/VNDB/DB/Misc.pm @@ -27,17 +27,16 @@ sub dbStats { sub dbItemEdit { my($self, $type, $oid, %o) = @_; - die "Only VNs are supported at this moment!" if $type ne 'v'; - $self->dbExec('SELECT edit_!s_init(?)', - {qw|v vn r releases p producers|}->{$type}, $oid); + my $fun = {qw|v vn r release p producer|}->{$type}; + $self->dbExec('SELECT edit_!s_init(?)', $fun, $oid); $self->dbExec('UPDATE edit_revision SET requester = ?, ip = ?, comments = ?', $o{uid}||$self->authInfo->{id}, $self->reqIP, $o{editsum}); $self->dbVNRevisionInsert( \%o) if $type eq 'v'; #$self->dbProducerRevisionInsert(\%o) if $type eq 'p'; - #$self->dbReleaseRevisionInsert( \%o) if $type eq 'r'; + $self->dbReleaseRevisionInsert( \%o) if $type eq 'r'; - return $self->dbRow('SELECT * FROM edit_vn_commit()'); + return $self->dbRow('SELECT * FROM edit_!s_commit()', $fun); } |