refactor: 일반 실행 경로의 DB 변경을 버전형 마이그레이션으로 이전

과거 누적 DDL과 데이터 보정을 시점별 SQL로 분리하고 관리자·CLI 실행기를 제공한다. 실행 순서, 잠금, 체크섬, 성공·실패 이력 및 개별 실행의 선행 조건을 검증한다.

기존 스키마의 부분 적용 복구와 설치 SQL 정합성 검사를 추가하고 실행·복구 절차를 문서화한다.
This commit is contained in:
whitedot committed 2026-09-09 07:58:05 +00:00
1 parent d111100856
commit 5bdbf360b0
76 files changed
+1826 -2182

No files matched your search

+1 -31
View File
@@ -2720,7 +2720,7 @@ function get_email_certify_token()
*/
function is_valid_email_certify_token($token, $stored_token, $mb_datetime, $valid_minutes, $now = null)
{
if (!$token || !$stored_token || !hash_equals((string) $stored_token, (string) $token)) {
if (!$token || !$stored_token || !slow_equals((string) $stored_token, (string) $token)) {
return false;
}
@@ -3663,21 +3663,6 @@ function insert_member_cert_history($mb_id, $name, $hp, $birth, $type)
$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history';
}
// 멤버 본인인증 정보 변경 내역 테이블 없을 경우 생성
if(isset($g5['member_cert_history_table']) && !sql_query(" DESC {$g5['member_cert_history_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['member_cert_history_table']}` (
`ch_id` int(11) NOT NULL auto_increment,
`mb_id` varchar(20) NOT NULL DEFAULT '',
`ch_name` varchar(255) NOT NULL DEFAULT '',
`ch_hp` varchar(255) NOT NULL DEFAULT '',
`ch_birth` varchar(255) NOT NULL DEFAULT '',
`ch_type` varchar(20) NOT NULL DEFAULT '',
`ch_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`ch_id`),
KEY `mb_id` (`mb_id`)
) ", true);
}
$sql = " insert into {$g5['member_cert_history_table']}
set mb_id = '{$mb_id}',
ch_name = '{$name}',
@@ -4235,21 +4220,6 @@ function login_password_check($mb, $pass, $hash)
if(!$mb_id)
return false;
if(G5_STRING_ENCRYPT_FUNCTION === 'create_hash' && (strlen($hash) === G5_MYSQL_PASSWORD_LENGTH || strlen($hash) === 16)) {
if( sql_password($pass) === $hash ){
if( ! isset($mb['mb_password2']) ){
$sql = "ALTER TABLE `{$g5['member_table']}` ADD `mb_password2` varchar(255) NOT NULL default '' AFTER `mb_password`";
sql_query($sql);
}
$new_password = create_hash($pass);
$sql = " update {$g5['member_table']} set mb_password = '$new_password', mb_password2 = '$hash' where mb_id = '$mb_id' ";
sql_query($sql);
return true;
}
}
return check_password($pass, $hash);
}