INSERT INTO rooms (name, room_type_id, s3_suffix) VALUES
    ('room164_wallpaper_standing', 1, 'standing/wallpaper/room164.jpg'),
    ('room165_wallpaper_standing', 1, 'standing/wallpaper/room165.jpg'),
    ('room166_wallpaper_standing', 1, 'standing/wallpaper/room166.jpg'),
    ('room167_wallpaper_standing', 1, 'standing/wallpaper/room167.jpg'),
    ('room168_wallpaper_standing', 1, 'standing/wallpaper/room168.jpg'),
    ('room169_wallpaper_standing', 1, 'standing/wallpaper/room169.jpg'),
    ('room170_wallpaper_standing', 1, 'standing/wallpaper/room170.jpg'),
    ('room171_wallpaper_standing', 1, 'standing/wallpaper/room171.jpg'),
    ('room172_wallpaper_standing', 1, 'standing/wallpaper/room172.jpg'),
    ('room173_wallpaper_standing', 1, 'standing/wallpaper/room173.jpg'),
    ('room174_wallpaper_standing', 1, 'standing/wallpaper/room174.jpg'),
    ('room175_wallpaper_standing', 1, 'standing/wallpaper/room175.jpg'),
    ('room176_wallpaper_standing', 1, 'standing/wallpaper/room176.jpg'),
    ('room177_wallpaper_standing', 1, 'standing/wallpaper/room177.jpg'),
    ('room178_wallpaper_standing', 1, 'standing/wallpaper/room178.jpg'),
    ('room179_wallpaper_standing', 1, 'standing/wallpaper/room179.jpg'),
    ('room180_wallpaper_standing', 1, 'standing/wallpaper/room180.jpg'),
    ('room181_wallpaper_standing', 1, 'standing/wallpaper/room181.jpg'),
    ('room182_wallpaper_standing', 1, 'standing/wallpaper/room182.jpg'),
    ('room183_wallpaper_standing', 1, 'standing/wallpaper/room183.jpg'),
    ('room184_wallpaper_standing', 1, 'standing/wallpaper/room184.jpg'),
    ('room185_wallpaper_standing', 1, 'standing/wallpaper/room185.jpg'),
    ('room186_wallpaper_standing', 1, 'standing/wallpaper/room186.jpg'),
    ('room187_wallpaper_standing', 1, 'standing/wallpaper/room187.jpg'),
    ('room188_wallpaper_standing', 1, 'standing/wallpaper/room188.jpg'),
    ('room189_wallpaper_standing', 1, 'standing/wallpaper/room189.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 = 'room164_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room164_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'kitchen')),
    ((SELECT id FROM rooms WHERE name = 'room165_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room165_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'living-room')),
    ((SELECT id FROM rooms WHERE name = 'room166_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'kitchen')),
    ((SELECT id FROM rooms WHERE name = 'room167_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office')),
    ((SELECT id FROM rooms WHERE name = 'room167_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room168_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'living-room')),
    ((SELECT id FROM rooms WHERE name = 'room168_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room169_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'living-room')),
    ((SELECT id FROM rooms WHERE name = 'room170_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'hallway')),
    ((SELECT id FROM rooms WHERE name = 'room170_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'living-room')),
    ((SELECT id FROM rooms WHERE name = 'room170_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room171_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bedroom')),
    ((SELECT id FROM rooms WHERE name = 'room172_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'living-room')),
    ((SELECT id FROM rooms WHERE name = 'room172_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room173_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'office')),
    ((SELECT id FROM rooms WHERE name = 'room173_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room174_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room174_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bathroom')),
    ((SELECT id FROM rooms WHERE name = 'room175_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room175_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bathroom')),
    ((SELECT id FROM rooms WHERE name = 'room176_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'dining-room')),
    ((SELECT id FROM rooms WHERE name = 'room177_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'living-room')),
    ((SELECT id FROM rooms WHERE name = 'room177_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room178_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'living-room')),
    ((SELECT id FROM rooms WHERE name = 'room178_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room179_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'kitchen')),
    ((SELECT id FROM rooms WHERE name = 'room180_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'dining-room')),
    ((SELECT id FROM rooms WHERE name = 'room181_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bedroom')),
    ((SELECT id FROM rooms WHERE name = 'room182_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bedroom')),
    ((SELECT id FROM rooms WHERE name = 'room182_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room183_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bathroom')),
    ((SELECT id FROM rooms WHERE name = 'room183_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room184_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'dining-room')),
    ((SELECT id FROM rooms WHERE name = 'room185_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bedroom')),
    ((SELECT id FROM rooms WHERE name = 'room185_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up')),
    ((SELECT id FROM rooms WHERE name = 'room186_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bathroom')),
    ((SELECT id FROM rooms WHERE name = 'room187_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'hallway')),
    ((SELECT id FROM rooms WHERE name = 'room188_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bedroom')),
    ((SELECT id FROM rooms WHERE name = 'room189_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'bathroom')),
    ((SELECT id FROM rooms WHERE name = 'room189_wallpaper_standing'), (SELECT id FROM roomtypes WHERE name = 'close-up'))
) 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;
