rev.2 for DB update

and fix mysql db driver
This commit is contained in:
Visman 2020-08-04 19:49:03 +07:00
parent f315502483
commit 5bfceba89e
5 changed files with 24 additions and 7 deletions

View file

@ -387,7 +387,7 @@ class Mysql
$this->testStr($table);
$this->testStr($field);
$query = "ALTER TABLE `{$table}` ADD `{$field}` " . $this->replType($type);
if ($allowNull) {
if (! $allowNull) {
$query .= ' NOT NULL';
}
if (null !== $default) {
@ -420,7 +420,7 @@ class Mysql
$this->testStr($table);
$this->testStr($field);
$query = "ALTER TABLE `{$table}` MODIFY `{$field}` " . $this->replType($type);
if ($allowNull) {
if (! $allowNull) {
$query .= ' NOT NULL';
}
if (null !== $default) {

View file

@ -900,8 +900,8 @@ class Install extends Admin
'yahoo' => ['VARCHAR(30)', false, ''],
'location' => ['VARCHAR(30)', false, ''],
'signature' => ['TEXT', false],
'disp_topics' => ['TINYINT(3) UNSIGNED', false, 0],
'disp_posts' => ['TINYINT(3) UNSIGNED', false, 0],
'disp_topics' => ['TINYINT UNSIGNED', false, 0],
'disp_posts' => ['TINYINT UNSIGNED', false, 0],
'email_setting' => ['TINYINT(1)', false, 1],
'notify_with_post' => ['TINYINT(1)', false, 0],
'auto_notify' => ['TINYINT(1)', false, 0],
@ -935,9 +935,11 @@ class Install extends Admin
'pmsn_last_post' => ['INT(10) UNSIGNED', false, 0],
'warning_flag' => ['TINYINT(1)', false, 0],
'warning_all' => ['INT(10) UNSIGNED', false, 0],
'gender' => ['TINYINT(4) UNSIGNED', false, 0],
'gender' => ['TINYINT UNSIGNED', false, 0],
'u_mark_all_read' => ['INT(10) UNSIGNED', false, 0],
'last_report_id' => ['INT(10) UNSIGNED', false, 0],
'ip_check_type' => ['TINYINT UNSIGNED', false, 0],
'login_ip_cache' => ['VARCHAR(255)', false, ''],
],
'PRIMARY KEY' => ['id'],
'UNIQUE KEYS' => [

View file

@ -426,4 +426,19 @@ class Update extends Admin
#
# return null;
# }
/**
* rev.1 to rev.2
*/
protected function stageNumber1(array $args): ?int
{
$this->c->DB->alterField('users', 'gender', 'TINYINT UNSIGNED', false, 0);
$this->c->DB->alterField('users', 'disp_topics', 'TINYINT UNSIGNED', false, 0);
$this->c->DB->alterField('users', 'disp_posts', 'TINYINT UNSIGNED', false, 0);
$this->c->DB->addField('users', 'ip_check_type', 'TINYINT UNSIGNED', false, 0);
$this->c->DB->addField('users', 'login_ip_cache', 'VARCHAR(255)', false, '');
return null;
}
}

View file

@ -41,7 +41,7 @@ if (
}
$c->PUBLIC_URL = $c->BASE_URL . $forkPublicPrefix;
$c->FORK_REVISION = 1;
$c->FORK_REVISION = 2;
$c->START = $forkStart;
$c->DIR_APP = __DIR__;
$c->DIR_PUBLIC = $forkPublic;

View file

@ -1,4 +1,4 @@
# ForkBB rev 1 Pre-Alpha Readme
# ForkBB rev 2 Pre-Alpha Readme
## About