-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
event 테이블 추가 #140
Comments
일단은 이렇습니다.
|
DROP TABLE IF EXISTS `event`;
CREATE TABLE `event` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(32) NOT NULL,
`desc` TEXT DEFAULT NULL,
`sponsor` VARCHAR(128) DEFAULT NULL,
`year` INT(11) DEFAULT 0 COMMENT '연도; 애매하면 0',
`nth` INT(11) DEFAULT 1 COMMENT '회차; 회차와 연도로 그룹화; 2018년 2회차; 2019년 1회차',
`start_date` DATETIME DEFAULT NULL,
`end_date` DATETIME DEFAULT NULL,
`create_date` DATETIME DEFAULT NULL,
`update_date` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; 좀 애매한게 연도가 애매해서 0으로 했는데 흥해서 2회차가 열렸다면? |
당장에 모든 곳에 |
쿼리를 실행하면,
와 같은 에러가 발생합니다.
왜 |
생년월일을 최근 배포가 5월달 이었으니 지금도 발생하고 있습니다. NULL 아니면 제대로 된 값이 들어갈 것으로 여겼지만 그렇지 않은 것 같습니다. optional 에 |
단순히
이것도 안됩니다. |
null 값을 허용하고 있고 이미 null 로 들어간 row 가 많은데 왜?
|
nullable datetime 타입의 컬럼을 null 로 변경할 수 없습니다. |
|
mysql> UPDATE `donation_form` SET `birth_date` = NULL WHERE `id` IN (SELECT `id` FROM `donation_form` WHERE `birth_date` = '0000-00-00 00:00:00');
UPDATE `donation_form` SET `birth_date` = NULL WHERE `id` IN (SELECT `id` FROM `donation_form` WHERE `birth_date` = '0000-00-00 00:00:00');
ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column 'birth_date' at row 1 |
이러한 에러가 발생합니다. |
그렇다면 얼마나 많은 쓰레기값이 들어가 있는지 확인을 해보고자 했습니다.
|
하고자 했던 것은 donation_form 테이블에 event_id 컬럼을 추가하고 외래키 설정을 걸어주는 것 이었습니다. 모든 쓰레기값을 찾아서 NULL 값으로 변경하면 될 것 같습니다. |
쓰레기 값은 |
datetime 컬럼의 쓰레기 값은 아래 쿼리로 변환할 수 있습니다. https://stackoverflow.com/a/37780259
|
OpenCloset-Schema-0.058.tar.gz 배포하였습니다. |
opencloset/donation#107
에서 필요로 추가합니다.
여기에서 쿠폰을 사용하지 않고 몇회째 대여인지 계산함
등에서
coupon.desc
에 이벤트명을 기록하고 사용하고 있는데,이러한 것들을 대체할 수 있습니다.
이벤트에 대한 상세 스펙을 정의해서 넣고
이벤트와 관련된 곳에서 해당 이벤트 id 를 참조해서 사용할 예정입니다.
이벤트에 대한 관리용 UI 도 필요할 수 있습니다.
이것을 활용하면 취업날개를 제외하고 통계 추가 작업을 자동화 할 수도 있을 것 같습니다.
The text was updated successfully, but these errors were encountered: