code: def save_migration(connection, basename):
      
  
      # Prepare query
      sql = "INSERT INTO migrations_applied (name, date) VALUES (%s, NOW())"
  
      # Run
      with connection.cursor() as cursor:
          cursor.execute(sql, (basename,))
          connection.commit()
  
      return True
docs: Save a migration in `migrations_applied` table