diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 4fa8cf87f..a65335dab 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.3.9 + - fix: SQL Form and big table imports - fix: Can't add task to project management (perlDreamer Consulting, LLC) - fix: Error in RSS Feed (perlDreamer Consulting, LLC) - rfe: Asset->get should return a copy of the properties hashref diff --git a/lib/WebGUI/Asset/Wobject/SQLForm.pm b/lib/WebGUI/Asset/Wobject/SQLForm.pm index d19fee55e..550825a23 100644 --- a/lib/WebGUI/Asset/Wobject/SQLForm.pm +++ b/lib/WebGUI/Asset/Wobject/SQLForm.pm @@ -1376,29 +1376,17 @@ my $hasPrimaryKey = 0; " "); # fill status fields - $sth = $dbLink->db->read("select * from $tableName"); - while (my %row = $sth->hash) { - my @where = (); - foreach (@columnNames) { - if (defined $row{$_}) { - push(@where, $_." = ".$self->session->db->quote($row{$_})); - } else { - push(@where, "$_ IS NULL"); - } - } - my $sql = - "update $tableName set ". - "__recordId = ".$self->session->db->quote($self->session->id->generate).", ". - "__creationDate = ".$self->session->db->quote(time).", ". - "__createdBy = ".$self->session->db->quote($self->session->user->userId).", ". - "__initDate = ".$self->session->db->quote(time).", ". - "__userId = ".$self->session->db->quote($self->session->user->userId).", ". - "__archived = 0, ". - "__revision = 1 ". - "where ".join(' and ', @where); - $dbLink->db->write($sql); - #print "$sql\n"; - } + my $sql = + "update $tableName set ". + "__recordId = (select concat(rand(),rand())),". + "__creationDate = ".$self->session->db->quote(time).", ". + "__createdBy = ".$self->session->db->quote($self->session->user->userId).", ". + "__initDate = ".$self->session->db->quote(time).", ". + "__userId = ".$self->session->db->quote($self->session->user->userId).", ". + "__archived = 0, ". + "__revision = 1 "; + $dbLink->db->write($sql); + #print "$sql\n"; } $dbLink->db->write("alter table $tableName add primary key (__recordId, __revision)");