16 $countAuthorColumns = $dbManager->getSingleRow(
"SELECT count(*) FROM copyright WHERE type <> 'statement' AND content IS NOT NULL;",array(),
'getCountAuthorColumns');
18 if($countAuthorColumns[
'count'] > 0){
20 echo
"Insert email/url/author data from copyright to author table... \nIt takes some time depending number of columns... \n";
22 $dbManager->queryOnce(
"INSERT INTO author (agent_fk, pfile_fk, content, hash, type, copy_startbyte, copy_endbyte, is_enabled)
23 SELECT agent_fk, pfile_fk, content, hash, type, copy_startbyte, copy_endbyte, is_enabled
24 FROM copyright WHERE type <> 'statement' AND content IS NOT NULL;");
25 $countInsertedAuthorColumns = $dbManager->getSingleRow(
"SELECT count(*) FROM author au INNER JOIN copyright co
26 ON au.pfile_fk = co.pfile_fk WHERE au.author_pk = co.copyright_pk AND au.content = co.content;",array(),
'getCountInsertedAuthorColumns');
27 if($countAuthorColumns[
'count'] == $countInsertedAuthorColumns[
'count']){
28 echo
"Deleting the email/url/author data from copyright table...\n";
29 $dbManager->queryOnce(
"DELETE FROM copyright WHERE type <> 'statement' AND content IS NOT NULL;");
31 echo
"Something went wrong please execute the postinstall again...\n";