뽀린키 속성을 없앤다
Find the name of the foreign key constraint (you can see it in the error message or by looking up the table structure), and then drop it:
ALTER TABLE machine_report_attachment DROP FOREIGN KEY machine_report_attac_form_id_b4c038bd_fk_machine_r;
form_id속성을 다시 부여한다
Now, modify the column to be nullable as initially intended:
ALTER TABLE machine_report_attachment MODIFY form_id BIGINT NULL;
Step 3:뽀린키 속성을 다시 부여한다
If the relationship is still necessary, add the foreign key constraint back with the new settings. Ensure that the referenced primary key column (id in MachineReportForm) is compatible:
ALTER TABLE machine_report_attachment
ADD CONSTRAINT fk_machine_report_attachment_form_id
FOREIGN KEY (form_id) REFERENCES machine_report_form(id);
'Django 장고' 카테고리의 다른 글
413 Request Entity Too Large 에러 (0) | 2024.11.12 |
---|---|
원투매니에서 발생하는 플러스원 이슈 (1) | 2024.10.24 |
장고 no reload로 키기 (0) | 2024.09.11 |
장고 date가 'null' 로 들어가서 나는 에러 해결 (0) | 2024.07.02 |
mysql접속할 수 없는상태에서 비밀번호 변경 (0) | 2024.06.26 |