Files
Gnuboard5/migrations/20160909_001_shop_coupon_zone.sql
T
whitedot 5bdbf360b0 refactor: 일반 실행 경로의 DB 변경을 버전형 마이그레이션으로 이전
과거 누적 DDL과 데이터 보정을 시점별 SQL로 분리하고 관리자·CLI 실행기를 제공한다. 실행 순서, 잠금, 체크섬, 성공·실패 이력 및 개별 실행의 선행 조건을 검증한다.

기존 스키마의 부분 적용 복구와 설치 SQL 정합성 검사를 추가하고 실행·복구 절차를 문서화한다.
2026-09-09 07:58:05 +00:00

18 lines
1.2 KiB
SQL

-- @description 쿠폰존 테이블과 쿠폰 연결 필드 추가 (6e1aa4ac0)
-- @if-table-exists {{g5_shop_cart_table}}
-- @if-table-missing {{g5_shop_coupon_zone_table}}
CREATE TABLE `{{g5_shop_coupon_zone_table}}` (
`cz_id` int(11) NOT NULL AUTO_INCREMENT, `cz_type` tinyint(4) NOT NULL DEFAULT '0',
`cz_subject` varchar(255) NOT NULL DEFAULT '', `cz_start` date NOT NULL DEFAULT '0000-00-00',
`cz_end` date NOT NULL DEFAULT '0000-00-00', `cz_file` varchar(255) NOT NULL DEFAULT '',
`cz_period` int(11) NOT NULL DEFAULT '0', `cz_point` int(11) NOT NULL DEFAULT '0',
`cp_method` tinyint(4) NOT NULL DEFAULT '0', `cp_target` varchar(255) NOT NULL DEFAULT '',
`cp_price` int(11) NOT NULL DEFAULT '0', `cp_type` tinyint(4) NOT NULL DEFAULT '0',
`cp_trunc` int(11) NOT NULL DEFAULT '0', `cp_minimum` int(11) NOT NULL DEFAULT '0',
`cp_maximum` int(11) NOT NULL DEFAULT '0', `cz_download` int(11) NOT NULL DEFAULT '0',
`cz_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`cz_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- @if-table-exists {{g5_shop_coupon_table}}
-- @if-column-missing {{g5_shop_coupon_table}} cz_id
ALTER TABLE `{{g5_shop_coupon_table}}` ADD `cz_id` int(11) NOT NULL DEFAULT '0' AFTER `mb_id`;