Make slug as ID Number for custom post types

Here’s a way how to change the slug:

add_action('wp_insert_post', 'change_slug');
function change_slug( $post_id ) {

       // Making sure this runs only when a 'eduation' post type is created
       $slug = 'eduation';
       if ( $slug != $_POST['post_type'] ) {
          return;
       }


       wp_update_post( array(
        'ID' => $post_id,
        'post_name' => $post_id // slug
       ));

}