mirror of
https://github.com/hwanny1128/HGZero.git
synced 2025-12-06 19:36:23 +00:00
40 lines
1.6 KiB
SQL
40 lines
1.6 KiB
SQL
-- ====================================================================
|
|
-- Notification DB 체크 제약 조건 수정 스크립트
|
|
-- ====================================================================
|
|
-- 목적: notification_type의 체크 제약 조건을 Java Enum과 일치시킴
|
|
-- 날짜: 2025-10-26
|
|
-- ====================================================================
|
|
|
|
-- 1. 현재 체크 제약 조건 확인
|
|
SELECT constraint_name, check_clause
|
|
FROM information_schema.check_constraints
|
|
WHERE constraint_name = 'notifications_notification_type_check';
|
|
|
|
-- 2. 기존 체크 제약 조건 삭제
|
|
ALTER TABLE notifications DROP CONSTRAINT IF EXISTS notifications_notification_type_check;
|
|
|
|
-- 3. 새로운 체크 제약 조건 추가 (Java Enum의 모든 값 포함)
|
|
ALTER TABLE notifications
|
|
ADD CONSTRAINT notifications_notification_type_check
|
|
CHECK (notification_type IN (
|
|
'MEETING_INVITATION', -- 회의 초대
|
|
'TODO_ASSIGNED', -- Todo 할당
|
|
'TODO_REMINDER', -- Todo 리마인더
|
|
'MEETING_REMINDER', -- 회의 리마인더
|
|
'MINUTES_UPDATED', -- 회의록 수정
|
|
'TODO_COMPLETED' -- Todo 완료
|
|
));
|
|
|
|
-- 4. 업데이트 결과 확인
|
|
SELECT constraint_name, check_clause
|
|
FROM information_schema.check_constraints
|
|
WHERE constraint_name = 'notifications_notification_type_check';
|
|
|
|
-- 5. 테이블 정보 확인
|
|
\d+ notifications
|
|
|
|
-- ====================================================================
|
|
-- 참고: Java Enum 위치
|
|
-- notification/src/main/java/com/unicorn/hgzero/notification/domain/Notification.java:220-227
|
|
-- ====================================================================
|