28 $countAuthorColumns = $dbManager->getSingleRow(
"SELECT count(*) FROM copyright WHERE type <> 'statement' AND content IS NOT NULL;",array(),
'getCountAuthorColumns');
30 if($countAuthorColumns[
'count'] > 0){
32 echo
"Insert email/url/author data from copyright to author table... \nIt takes some time depending number of columns... \n";
34 $dbManager->queryOnce(
"INSERT INTO author (agent_fk, pfile_fk, content, hash, type, copy_startbyte, copy_endbyte, is_enabled) 35 SELECT agent_fk, pfile_fk, content, hash, type, copy_startbyte, copy_endbyte, is_enabled 36 FROM copyright WHERE type <> 'statement' AND content IS NOT NULL;");
37 $countInsertedAuthorColumns = $dbManager->getSingleRow(
"SELECT count(*) FROM author au INNER JOIN copyright co 38 ON au.pfile_fk = co.pfile_fk WHERE au.author_pk = co.copyright_pk AND au.content = co.content;",array(),
'getCountInsertedAuthorColumns');
39 if($countAuthorColumns[
'count'] == $countInsertedAuthorColumns[
'count']){
40 echo
"Deleting the email/url/author data from copyright table...\n";
41 $dbManager->queryOnce(
"DELETE FROM copyright WHERE type <> 'statement' AND content IS NOT NULL;");
43 echo
"Something went wrong please execute the postinstall again...\n";