2019-08-05 00:30:07 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Zotlabs\Update;
|
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
class _1234
|
|
|
|
{
|
2019-08-05 00:30:07 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
public function run()
|
|
|
|
{
|
2019-08-05 00:30:07 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
q("START TRANSACTION");
|
2019-08-05 00:30:07 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
$r = q("ALTER TABLE oauth_clients ADD client_name VARCHAR(80) ");
|
2019-08-05 00:30:07 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
if ($r) {
|
|
|
|
q("COMMIT");
|
|
|
|
return UPDATE_SUCCESS;
|
|
|
|
}
|
2019-08-05 00:30:07 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
q("ROLLBACK");
|
|
|
|
return UPDATE_FAILED;
|
|
|
|
}
|
2019-08-05 00:30:07 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
public function verify()
|
|
|
|
{
|
2019-08-05 00:30:07 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
$columns = db_columns('oauth_clients');
|
2019-08-05 00:30:07 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
if (in_array('client_name', $columns)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2019-08-05 00:30:07 +00:00
|
|
|
}
|