def METHOD_NAME():
    id_constraint_name = find_fk('command_queue', ['id'])
    op.execute("""
        ALTER TABLE command_queue
        DROP COLUMN updated,
        DROP COLUMN task_id,
        DROP FOREIGN KEY %s,
        MODIFY id INT NOT NULL AUTO_INCREMENT,
        ADD COLUMN user_id INT DEFAULT NULL AFTER id,
        ADD CONSTRAINT command_queue_user_id_fk
            FOREIGN KEY (user_id) REFERENCES tg_user (user_id),
        ADD COLUMN service VARCHAR(100) NOT NULL AFTER user_id,
        ADD INDEX (service),
        ADD COLUMN queue_time DATETIME NOT NULL AFTER service,
        ADD INDEX (queue_time),
        ADD COLUMN start_time DATETIME DEFAULT NULL AFTER queue_time,
        ADD INDEX (start_time),
        ADD COLUMN finish_time DATETIME DEFAULT NULL AFTER start_time,
        ADD INDEX (finish_time),
        ADD COLUMN action VARCHAR(40) NOT NULL after system_id,
        ADD INDEX (action),
        ADD COLUMN error_message VARCHAR(4000) DEFAULT NULL AFTER quiescent_period
        """
        % id_constraint_name)
    op.execute("""
        UPDATE command_queue
        INNER JOIN activity ON activity.id = command_queue.id
        SET command_queue.user_id = activity.user_id,
        command_queue.service = activity.service,
        command_queue.queue_time = activity.created,
        command_queue.action = activity.action,
        command_queue.error_message = NULLIF(activity.new_value, '')
        """)
    op.execute("""
        DELETE FROM activity
        WHERE type = 'command_activity'
        """)