From efc94c0d9f1289cc14fb52c0d40bb5180e5b3d3b Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Mon, 5 Nov 2007 12:56:13 +0100 Subject: [PATCH] DBI now uses story->new_id(). --- Gruta/Source/DBI.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Gruta/Source/DBI.pm b/Gruta/Source/DBI.pm index 5aeeaf0..723f4c0 100644 --- a/Gruta/Source/DBI.pm +++ b/Gruta/Source/DBI.pm @@ -431,15 +431,16 @@ sub insert_story { if (not $story->get('id')) { # alloc an id for the story - my $id = time(); + my $id = undef; my $sth = $self->_prepare( 'SELECT 1 FROM stories WHERE topic_id = ? AND id = ?'); do { - $id++; + $id = $story->new_id(); $self->_execute($sth, $story->get('topic_id'), $id); - } while ($sth->fetchrow_arrayref()); + + } while $sth->fetchrow_arrayref(); $story->set('id', $id); } -- 2.11.4.GIT