I am setting up next-auth for my app and trying to add login with email. I used mysql schemas from next-auth documentation and one of them is verification_requests:
CREATE TABLE verification_requests
(
id INT NOT NULL AUTO_INCREMENT,
identifier VARCHAR(255) NOT NULL,
token VARCHAR(255) NOT NULL,
expires TIMESTAMP(6) NOT NULL,
created_at TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updated_at TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
PRIMARY KEY (id)
);
When I try to login with email, it is giving following error: Field 'identifier' doesn't have a default value for following query:
INSERT INTO `verification_requests`(`id`, `identifier`, `token`, `expires`, `created_at`, `updated_at`) VALUES (DEFAULT, DEFAULT, '1db565ee611f2ed6c5ec0dacd79ac1fd3ffb860e1a249cfc7320b5e8381c0201', '2021-01-12 03:27:31.357', DEFAULT, DEFAULT)
I am getting this error because next-auth is trying to insert info verification_requests table but since the schema doesn't have default value for field identifier, it is throwing error. I couldn't find any thing mentioned about what kind of default value we need to declare in mysql schema for the Identifier field. Could anyone please help?