streams/Zotlabs/Update/_1167.php

27 lines
733 B
PHP
Raw Normal View History

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