streams/Code/Update/_1233.php

36 lines
544 B
PHP
Raw Normal View History

2019-07-31 00:56:35 +00:00
<?php
2022-02-16 04:08:28 +00:00
namespace Code\Update;
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
class _1233
{
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
public function run()
{
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
q("START TRANSACTION");
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
$r = q("ALTER TABLE abook ADD abook_censor INT UNSIGNED NOT NULL DEFAULT '0' ");
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
if ($r) {
q("COMMIT");
return UPDATE_SUCCESS;
}
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
q("ROLLBACK");
return UPDATE_FAILED;
}
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
public function verify()
{
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
$columns = db_columns('abook');
2019-07-31 00:56:35 +00:00
2021-12-02 23:02:31 +00:00
if (in_array('abook_censor', $columns)) {
return true;
}
return false;
}
2019-07-31 00:56:35 +00:00
}