-- Check current SQL modes
SELECT @@sql_mode;
-- Set SQL mode without NO_ZERO_DATE and NO_ZERO_IN_DATE
SET sql_mode = REPLACE(@@sql_mode, 'NO_ZERO_IN_DATE', '');
SET sql_mode = REPLACE(@@sql_mode, 'NO_ZERO_DATE', '');
-- Update the devices table
UPDATE devices
SET last_seen = NULL
WHERE last_seen = '0000-00-00 00:00:00';
-- Set the SQL mode back to its original setting
-- Replace 'your_original_sql_mode' with the mode you obtained from the first query
SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
