ALTER TABLE medias ADD timezone CHAR(64) AFTER posted_on;
ALTER TABLE messages ADD timezone CHAR(64) AFTER site_time;
ALTER TABLE posts ADD timezone CHAR(64) AFTER site_time;

UPDATE messages
    SET iso_time = DATE_FORMAT(CONVERT_TZ(LEFT(iso_time, 19),'+00:00','+02:00'), '%Y-%m-%dT%T+0200'),
        led = led
    WHERE id_feed = 2;

UPDATE messages
    INNER JOIN feeds ON feeds.id_feed = messages.id_feed
    INNER JOIN projects ON projects.id_project = feeds.id_project
    SET messages.timezone = projects.timezone,
        messages.led = messages.led;

UPDATE posts
    SET timezone = 'Europe/Paris',
        led = led;

UPDATE posts
    INNER JOIN projects ON projects.id_project = posts.id_project
    SET posts.id_user = 1,
        posts.timezone = projects.timezone,
        posts.led = posts.led
    WHERE posts.name IN ('francois', 'françois','Francois', 'François', 'franzz');

UPDATE posts
    SET timezone = 'Pacific/Auckland',
        led = led
    WHERE name = 'nz';

UPDATE posts
    SET timezone = 'Atlantic/Madeira',
        led = led
    WHERE id_post IN (141, 142);

UPDATE medias
    INNER JOIN projects ON projects.id_project = medias.id_project
    SET medias.timezone = projects.timezone,
        medias.led = medias.led;

UPDATE medias
    SET timezone = 'Atlantic/Madeira',
        taken_on = posted_on,
        led = led
    WHERE id_media IN (64, 65);

ALTER TABLE projects DROP COLUMN timezone;

UPDATE maps SET attribution = 'OpenTopoMap (CC-BY-SA)' WHERE id_map = 2;
