You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

9 lines
358 B

-- routes add creator_id
ALTER TABLE routes ADD COLUMN creator_id BIGINT NULL COMMENT 'route creator user id' AFTER attributes;
-- backfill: set creator_id = room owner_id for existing routes
UPDATE routes r
JOIN mission_scenario ms ON r.scenario_id = ms.id
JOIN rooms rm ON ms.room_id = rm.id
SET r.creator_id = rm.owner_id
WHERE r.creator_id IS NULL;