You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 20221221073259_sanitize_user_accessibility_in_users.rb
    path of file: ./repos/violet_rails/db/migrate
    
    the code of the file until where you have to start completion: class SanitizeUserAccessibilityInUsers < ActiveRecord::Migration[6.1]
  def up
    User.all.each do |user|
      unless user.api_accessibility['api_namespa
    
  def up
    User.all.each do |user|
      unless user.api_accessibility['api_namespaces'].present?
        old_api_accessibility = user.api_accessibility
        new_api_accessibility = {'api_namespaces' => old_api_accessibility}
        new_api_accessibility['api_keys'] = {'full_access' => 'true'} if old_api_accessibility.dig('all_namespaces', 'full_access') == 'true'

        user.update!(api_accessibility: new_api_accessibility)
      end
    end