Getting Error Code: 1054. Unknown column 'identification' in 'field list' using this simple insert:
insert into document (`title`, `patient_id`, `file_type`, `doc_type`, `identification`)
values ('VISA BLUE GRACE2.png', '122', 'image/png', 'document', '0');
Existing stackoverflow answers talk about using backticks vs. single / double quotes which I believe I’m doing correctly here.
Omitting the column from the insert is successful and adds the default value. What gives? I even reboot mysql because I did recently change that column name.
Table definition:
CREATE TABLE `document` (
`id` int NOT NULL AUTO_INCREMENT,
`patient_id` int NOT NULL,
`title` varchar(100) NOT NULL,
`file_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`doc_type` varchar(50) NOT NULL,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`indentification` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=94 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
>Solution :
Table defintion has different column name indentification instead of identification(typo)
Referring to the appropriate column name will resolve this issue.