streams/Zotlabs/Update/_1139.php

22 lines
662 B
PHP
Raw Normal View History

<?php
namespace Zotlabs\Update;
2021-12-02 23:02:31 +00:00
class _1139
{
public function run()
{
if (ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("ALTER TABLE channel ADD channel_lastpost timestamp NOT NULL DEFAULT '0001-01-01 00:00:00'");
$r2 = q("create index channel_lastpost on channel ( channel_lastpost ) ");
$r = $r1 && $r2;
2021-12-03 03:01:39 +00:00
} else {
2021-12-02 23:02:31 +00:00
$r = q("ALTER TABLE `channel` ADD `channel_lastpost` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00' AFTER `channel_dirdate` , ADD INDEX ( `channel_lastpost` ) ");
2021-12-03 03:01:39 +00:00
}
if ($r) {
2021-12-02 23:02:31 +00:00
return UPDATE_SUCCESS;
2021-12-03 03:01:39 +00:00
}
2021-12-02 23:02:31 +00:00
return UPDATE_FAILED;
}
2021-12-03 03:01:39 +00:00
}