I'm having the same issue.. my MySQL version is 8.0.35-0ubuntu0.22.04.1
Whenever I edit a timestamp's default value and set it to the CURRENT_TIMESTAMP() expression and save and reload the table; it reverts back to a string 'CURRENT_TIMESTAMP' instead. It's asif HeidiSQL is not aware that CURRENT_TIMESTAMP is a reserved keyword.
I think that it's best resolved by retrieving the list of reserved keywords first with this query:
SELECT * FROM information_schema.KEYWORDS WHERE RESERVED=1;
and then deciding on how to handle generating the CREATE code based on what reserved keywords it finds.
This is Heidi's CREATE code:
CREATE TABLE `settings` (
`key` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_unicode_ci',
`value` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_unicode_ci',
`account_id` INT(10) UNSIGNED NULL DEFAULT NULL,
`created_at` TIMESTAMP NULL DEFAULT 'CURRENT_TIMESTAMP',
`updated_at` TIMESTAMP NULL DEFAULT 'CURRENT_TIMESTAMP' ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`key`, `value`) USING BTREE
)
COLLATE='utf8mb4_unicode_ci'
ENGINE=InnoDB
;
However, MySQL's way of rendering the CREATE code, shown with this query:
SHOW CREATE TABLE `email_responder`.`settings`;```:
.. results in this "Create Table" field value:
CREATE TABLE `settings` (
`key` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`value` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`account_id` int unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`key`,`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
This one has the correct default value for created_at and updated_at