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

+20
View File
@@ -223,6 +223,8 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
`cf_intercept_ip` text NOT NULL,
`cf_analytics` text NOT NULL,
`cf_add_meta` text NOT NULL,
`cf_syndi_token` varchar(255) NOT NULL DEFAULT '',
`cf_syndi_except` text NOT NULL,
`cf_member_skin` varchar(50) NOT NULL DEFAULT '',
`cf_use_homepage` tinyint(4) NOT NULL DEFAULT '0',
`cf_req_homepage` tinyint(4) NOT NULL DEFAULT '0',
@@ -989,3 +991,21 @@ CREATE TABLE IF NOT EXISTS `g5_menu` (
`me_mobile_use` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`me_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `g5_migrations`
--
DROP TABLE IF EXISTS `g5_migrations`;
CREATE TABLE IF NOT EXISTS `g5_migrations` (
`migration_id` varchar(100) NOT NULL,
`description` varchar(255) NOT NULL DEFAULT '',
`checksum` char(64) NOT NULL DEFAULT '',
`status` varchar(20) NOT NULL DEFAULT 'pending',
`error_message` text NOT NULL,
`execution_ms` int(11) NOT NULL DEFAULT '0',
`applied_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`migration_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;