I need to update the default value of all Synced
fields in a database tables.
I've looked at several other posts and put together the following, which I'm missing something, any ideas?
ALTER TABLE (
SELECT
DISTINCT
TABLE_NAME
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_SCHEMA != 'mysql'
AND TABLE_SCHEMA != 'information_schema'
AND COLUMN_NAME = 'Synced'
ORDER BY
TABLE_NAME ASC)
CHANGE `Synced` `Synced` TINYINT DEFAULT 0;
I've referenced the following to put it together: