federated polls: add poll_author which will be necessary for Diaspora federation

This commit is contained in:
zotlabs
2018-03-06 15:31:45 -08:00
parent b282e45a02
commit f0f58dade8
4 changed files with 31 additions and 1 deletions

26
Zotlabs/Update/_1208.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace Zotlabs\Update;
class _1208 {
function run() {
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("ALTER TABLE poll ADD poll_author text NOT NULL");
$r2 = q("create index \"poll_author_idx\" on poll \"poll_author\"");
$r = ($r1 && $r2);
}
else {
$r = q("ALTER TABLE `poll` ADD `poll_author` VARCHAR(191) NOT NULL AFTER `poll_votes`,
ADD INDEX `poll_author` (`poll_author`)");
}
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}