streams/Zotlabs/Update/_1165.php

23 lines
501 B
PHP
Raw Normal View History

<?php
namespace Zotlabs\Update;
2021-12-02 23:02:31 +00:00
class _1165
{
public function run()
{
2021-12-02 23:02:31 +00:00
$r1 = q("alter table hook add hook_version int not null default '0' ");
2021-12-03 03:01:39 +00:00
if (ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
2021-12-02 23:02:31 +00:00
$r2 = q("create index \"hook_version_idx\" on hook (\"hook_version\") ");
2021-12-03 03:01:39 +00:00
} else {
2021-12-02 23:02:31 +00:00
$r2 = q("alter table hook add index ( hook_version ) ");
2021-12-03 03:01:39 +00:00
}
if ($r1 && $r2) {
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
}