INSERT INTO rooms (name, room_type_id, s3_suffix) VALUES
    ('room190_wallpaper_standing', 1, 'standing/wallpaper/room190.jpg'),
    ('room191_wallpaper_standing', 1, 'standing/wallpaper/room191.jpg'),
    ('room192_wallpaper_standing', 1, 'standing/wallpaper/room192.jpg'),
    ('room193_wallpaper_standing', 1, 'standing/wallpaper/room193.jpg'),
    ('room194_wallpaper_standing', 1, 'standing/wallpaper/room194.jpg'),
    ('room195_wallpaper_standing', 1, 'standing/wallpaper/room195.jpg'),
    ('room196_wallpaper_standing', 1, 'standing/wallpaper/room196.jpg'),
    ('room197_wallpaper_standing', 1, 'standing/wallpaper/room197.jpg')
ON CONFLICT (name)
DO UPDATE SET
    room_type_id = EXCLUDED.room_type_id,
    s3_suffix = EXCLUDED.s3_suffix;

INSERT INTO room_roomtypes (room_id, roomtype_id)
SELECT t.room_id, t.roomtype_id
FROM (VALUES
    ((SELECT id FROM rooms WHERE name = 'room190_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office')),
    ((SELECT id FROM rooms WHERE name = 'room191_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office')),
    ((SELECT id FROM rooms WHERE name = 'room192_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office')),
    ((SELECT id FROM rooms WHERE name = 'room193_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office')),
    ((SELECT id FROM rooms WHERE name = 'room194_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bedroom')),
    ((SELECT id FROM rooms WHERE name = 'room195_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'dining-room')),
    ((SELECT id FROM rooms WHERE name = 'room195_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office')),
    ((SELECT id FROM rooms WHERE name = 'room196_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office')),
    ((SELECT id FROM rooms WHERE name = 'room197_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office'))
) AS t(room_id, roomtype_id)
WHERE EXISTS (SELECT 1 FROM rooms WHERE rooms.id = t.room_id)
ON CONFLICT (room_id, roomtype_id) DO NOTHING;
