codestates / codestates/ThereWeather
[👾 Error Handling] ERROR 1828 (HY000): Cannot drop column 'post_id': needed in a foreign key constraint 'custom_fkey_name'
- Lenguaje dominante
- JavaScript
- Estrellas
- 0
- Forks
- 3
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
## 어떤 에러인가요?
- 데이터베이스에서 foreign key 지정 후에 다시 삭제하려고, `alter table posts drop post_id;` 이 명령어를 치게 되면 바로 칼럼 삭제가 안될 때 나오는 에러메세지
## 에러 메시지
```jsx
ERROR 1828 (HY000): Cannot drop column 'post_id': needed in a foreign key constraint 'custom_fkey_name'
```
## 에러 핸들링 방법
```jsx
1. show create table posts[조회할 테이블명];
2. alter table posts[조회할 테이블명] drop foreign key custom_fkey_name[삭제할 foreign key 이름];
3. alter table posts[조회할 테이블명] drop post_id[삭제할 칼럼명];
```
## 에러 핸들링을 위해 참고한 레퍼런스 링크
[예시1](https://gcpark.tistory.com/23)
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
No file or test is named. Start by locating the repository's existing error-handling or database documentation and compare its format with this MySQL ERROR 1828 example; done means the error message and the three stated SQL handling steps are recorded consistently.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- mysql
- Área
- databases, documentation
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100